1.分析目录结构“tools”(或者说模板)

2.首先分析ibatorConfig.xml文件

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" >
<ibatorConfiguration> <classPathEntry
location="F:\sqljdbc.jar" />
<ibatorContext id="context1" targetRuntime="Ibatis2Java5"> <!--
classPathEntry 指定数据库jdbc驱动jar包的绝对路径。
--> <!--
id 这个id可以在使用命令行运行Abator时指定,以单独处理某一个ibatorContext targetRuntime
Ibatis2Java5 生成适合JDK5.0的类,另一个选项是 Ibatis2Java2,生成适合Java2的类。
--> <ibatorPlugin
type="org.apache.ibatis.ibator.plugins.RenameExampleClassPlugin">
<property name="searchString" value="Example$" />
<property name="replaceString" value="Example" />
</ibatorPlugin> <!--
ibatorPlugin 继承自IbatorPluginAdapter,包名必须是
org.apache.ibatis.ibator.plugins,具体实现可以参考官方文档 必须有替换和被替换字符属性。
-->
<!--
<jdbcConnection driverClass="org.postgresql.Driver"
connectionURL="jdbc:postgresql://127.0.0.1:5432/hibernateTest" userId="postgres"
password="postgres" />
-->
<jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionURL="jdbc:sqlserver://127.0.0.1:1433;databaseName=PanaDatabase" userId="sa"
password="sasa" /> <!--
driverClass 数据库驱动类 connectionURL 数据库连接地址 userId 用户 password 密码 还可以使用以下格式添加数据库的其他连接属性 <property name="" value=""/>
--> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> <!--
默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer true,把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal
--> </javaTypeResolver> <javaModelGenerator targetPackage="abator.model"
targetProject="comboFramework/tools" /> <!--
targetProject 生成的Java Bean放置在哪个项目的哪个目录下 targetPackage 生成的Java Bean的包名
一个有用的属性 <property name="trimStrings" value="true" /> 从数据库返回的值被清理前后的空格
<property name="enableSubPackages" value="false" /> 是否在包名后加上scheme名称
--> <sqlMapGenerator targetPackage="abator.sqlmap"
targetProject="comboFramework/tools" /> <!--
targetProject 生成的 SqlMap.xml 文件放置在哪个项目的哪个目录下 targetPackage 生成的
SqlMap.xml 文件的包名 <property name="enableSubPackages" value="false" />
是否在包名后加上scheme名称
--> <daoGenerator targetPackage="abator.dao" targetProject="comboFramework/tools"
type="GENERIC-CI" /> <table tableName="InfoVoteItm"></table> </ibatorContext>
</ibatorConfiguration>

需要注意的几点是

1.指向的jdbc包是否正确或存在

    <classPathEntry
location="F:\sqljdbc.jar" />
<ibatorContext id="context1" targetRuntime="Ibatis2Java5">

2.数据库连接是否配置正确

        <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionURL="jdbc:sqlserver://127.0.0.1:1433;databaseName=PanaDatabase" userId="sa"
password="sasa" />

3.指向的模板工具是否正确

        <!--
targetProject 生成的Java Bean放置在哪个项目的哪个目录下 targetPackage 生成的Java Bean的包名
一个有用的属性 <property name="trimStrings" value="true" /> 从数据库返回的值被清理前后的空格
<property name="enableSubPackages" value="false" /> 是否在包名后加上scheme名称
--> <sqlMapGenerator targetPackage="abator.sqlmap"
targetProject="comboFramework/tools" /> <!--
targetProject 生成的 SqlMap.xml 文件放置在哪个项目的哪个目录下 targetPackage 生成的
SqlMap.xml 文件的包名 <property name="enableSubPackages" value="false" />
是否在包名后加上scheme名称
--> <daoGenerator targetPackage="abator.dao" targetProject="comboFramework/tools"
type="GENERIC-CI" />

4.指向需要生成的表

<table  tableName="InfoVoteItm"></table>

这里是单表(还没试过多个表一起生成呢,可以试试)

最终生成的结果如图

可以看出对iBATIS对表InfoVoteItm生成了三个模块即"sqlmap","model","dao"。

现在我们一个一个的来分析这三个部分。

在分析之前了解下InfoVoteItm表的结构

USE [PanaDatabase]
GO
/****** 对象: Table [dbo].[InfoVoteItm] 脚本日期: 06/04/2012 16:22:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[InfoVoteItm](
[EmpID] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NULL,
[InfoDetail_ID] [int] NULL,
[VoteItmDate] [datetime] NULL CONSTRAINT [DF_InfoVoteItm_VoteItmDate] DEFAULT (getdate())
) ON [PRIMARY]

A.首先我们来分析"sqlmap"这一部分对InfoVoteItm表生成的文件InfoVoteItm_SqlMap.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="InfoVoteItm" >
<resultMap id="ibatorgenerated_BaseResultMap" class="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
<result column="EmpID" property="empid" jdbcType="VARCHAR" />
<result column="InfoDetail_ID" property="infodetailId" jdbcType="INTEGER" />
<result column="VoteItmDate" property="voteitmdate" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="ibatorgenerated_Example_Where_Clause" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
<iterate property="oredCriteria" conjunction="or" prepend="where" removeFirstPrepend="iterate" >
<isEqual property="oredCriteria[].valid" compareValue="true" >
(
<iterate prepend="and" property="oredCriteria[].criteriaWithoutValue" conjunction="and" >
$oredCriteria[].criteriaWithoutValue[]$
</iterate>
<iterate prepend="and" property="oredCriteria[].criteriaWithSingleValue" conjunction="and" >
$oredCriteria[].criteriaWithSingleValue[].condition$
#oredCriteria[].criteriaWithSingleValue[].value#
</iterate>
<iterate prepend="and" property="oredCriteria[].criteriaWithListValue" conjunction="and" >
$oredCriteria[].criteriaWithListValue[].condition$
<iterate property="oredCriteria[].criteriaWithListValue[].values" open="(" close=")" conjunction="," >
#oredCriteria[].criteriaWithListValue[].values[]#
</iterate>
</iterate>
<iterate prepend="and" property="oredCriteria[].criteriaWithBetweenValue" conjunction="and" >
$oredCriteria[].criteriaWithBetweenValue[].condition$
#oredCriteria[].criteriaWithBetweenValue[].values[0]# and
#oredCriteria[].criteriaWithBetweenValue[].values[1]#
</iterate>
)
</isEqual>
</iterate>
</sql>
<select id="ibatorgenerated_selectByExample" resultMap="ibatorgenerated_BaseResultMap" parameterClass="abator.model.InfovoteitmExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
select EmpID, InfoDetail_ID, VoteItmDate
from InfoVoteItm
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
<isNotNull property="orderByClause" >
order by $orderByClause$
</isNotNull>
</isParameterPresent>
</select>
<delete id="ibatorgenerated_deleteByExample" parameterClass="abator.model.InfovoteitmExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
delete from InfoVoteItm
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</delete>
<insert id="ibatorgenerated_insert" parameterClass="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
insert into InfoVoteItm (EmpID, InfoDetail_ID, VoteItmDate)
values (#empid:VARCHAR#, #infodetailId:INTEGER#, #voteitmdate:TIMESTAMP#)
</insert>
<insert id="ibatorgenerated_insertSelective" parameterClass="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
insert into InfoVoteItm
<dynamic prepend="(" >
<isNotNull prepend="," property="empid" >
EmpID
</isNotNull>
<isNotNull prepend="," property="infodetailId" >
InfoDetail_ID
</isNotNull>
<isNotNull prepend="," property="voteitmdate" >
VoteItmDate
</isNotNull>
)
</dynamic>
values
<dynamic prepend="(" >
<isNotNull prepend="," property="empid" >
#empid:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="infodetailId" >
#infodetailId:INTEGER#
</isNotNull>
<isNotNull prepend="," property="voteitmdate" >
#voteitmdate:TIMESTAMP#
</isNotNull>
)
</dynamic>
</insert>
<select id="ibatorgenerated_countByExample" parameterClass="abator.model.InfovoteitmExample" resultClass="java.lang.Integer" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
select count(*) from InfoVoteItm
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</select>
<update id="ibatorgenerated_updateByExampleSelective" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
update InfoVoteItm
<dynamic prepend="set" >
<isNotNull prepend="," property="record.empid" >
EmpID = #record.empid:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="record.infodetailId" >
InfoDetail_ID = #record.infodetailId:INTEGER#
</isNotNull>
<isNotNull prepend="," property="record.voteitmdate" >
VoteItmDate = #record.voteitmdate:TIMESTAMP#
</isNotNull>
</dynamic>
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</isParameterPresent>
</update>
<update id="ibatorgenerated_updateByExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
update InfoVoteItm
set EmpID = #record.empid:VARCHAR#,
InfoDetail_ID = #record.infodetailId:INTEGER#,
VoteItmDate = #record.voteitmdate:TIMESTAMP#
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</isParameterPresent>
</update>
</sqlMap>

可以看出对表InfoVoteItm做了实体映射(实现增加add,删除delete,修改update,查询select)

首先分析下映射实体类

  <resultMap id="ibatorgenerated_BaseResultMap" class="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
<result column="EmpID" property="empid" jdbcType="VARCHAR" />
<result column="InfoDetail_ID" property="infodetailId" jdbcType="INTEGER" />
<result column="VoteItmDate" property="voteitmdate" jdbcType="TIMESTAMP" />
</resultMap>

其中"id"起标识的作用,"class"映射由iBATIS生成的实体类(路径指向,若要移动该文件此处要及得修改)

"column"可以随意定义但前提是实体类中有相匹配的字段即"property","jdbcType"设置字段属性(属性与数据库字段类型相同)

查询(可以看出resultMap是对实体类的一种映射,如果查询select中的字段在实体类中未定义则会出现异常,parameterClass指向的是参数需要注意与class的区别)

  <select id="ibatorgenerated_selectByExample" resultMap="ibatorgenerated_BaseResultMap" parameterClass="abator.model.InfovoteitmExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
select EmpID, InfoDetail_ID, VoteItmDate
from InfoVoteItm
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
<isNotNull property="orderByClause" >
order by $orderByClause$
</isNotNull>
</isParameterPresent>
</select>

查询返回结果值

  <select id="ibatorgenerated_countByExample" parameterClass="abator.model.InfovoteitmExample" resultClass="java.lang.Integer" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
select count(*) from InfoVoteItm
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</select>

删除

  <delete id="ibatorgenerated_deleteByExample" parameterClass="abator.model.InfovoteitmExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
delete from InfoVoteItm
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</delete>

添加

1.添加所有项

  <insert id="ibatorgenerated_insert" parameterClass="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
insert into InfoVoteItm (EmpID, InfoDetail_ID, VoteItmDate)
values (#empid:VARCHAR#, #infodetailId:INTEGER#, #voteitmdate:TIMESTAMP#)
</insert>

2.选择性添加

  <insert id="ibatorgenerated_insertSelective" parameterClass="abator.model.Infovoteitm" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
insert into InfoVoteItm
<dynamic prepend="(" >
<isNotNull prepend="," property="empid" >
EmpID
</isNotNull>
<isNotNull prepend="," property="infodetailId" >
InfoDetail_ID
</isNotNull>
<isNotNull prepend="," property="voteitmdate" >
VoteItmDate
</isNotNull>
)
</dynamic>
values
<dynamic prepend="(" >
<isNotNull prepend="," property="empid" >
#empid:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="infodetailId" >
#infodetailId:INTEGER#
</isNotNull>
<isNotNull prepend="," property="voteitmdate" >
#voteitmdate:TIMESTAMP#
</isNotNull>
)
</dynamic>
</insert>

变更

1.选择性变更(条件可选)

  <update id="ibatorgenerated_updateByExampleSelective" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
update InfoVoteItm
<dynamic prepend="set" >
<isNotNull prepend="," property="record.empid" >
EmpID = #record.empid:VARCHAR#
</isNotNull>
<isNotNull prepend="," property="record.infodetailId" >
InfoDetail_ID = #record.infodetailId:INTEGER#
</isNotNull>
<isNotNull prepend="," property="record.voteitmdate" >
VoteItmDate = #record.voteitmdate:TIMESTAMP#
</isNotNull>
</dynamic>
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</isParameterPresent>
</update>

2.条件必须

  <update id="ibatorgenerated_updateByExample" >
<!--
WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
This element was generated on Wed Mar 09 16:57:25 CST 2011.
-->
update InfoVoteItm
set EmpID = #record.empid:VARCHAR#,
InfoDetail_ID = #record.infodetailId:INTEGER#,
VoteItmDate = #record.voteitmdate:TIMESTAMP#
<isParameterPresent >
<include refid="InfoVoteItm.ibatorgenerated_Example_Where_Clause" />
</isParameterPresent>
</update>

"model"是对实体类的封装就不说了,看下"dao"层。

"dao"层生成了两个文件InfovoteitmDAO是接口类对方法的声明(包括增,删,改,查)而InfovoteitmDAOImpl是类是对InfovoteitmDAO接口方法的

实现。

InfovoteitmDAO 接口
package abator.dao;

import abator.model.Infovoteitm;
import abator.model.InfovoteitmExample;
import java.sql.SQLException;
import java.util.List; public interface InfovoteitmDAO {
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
int countByExample(InfovoteitmExample example) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
int deleteByExample(InfovoteitmExample example) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
void insert(Infovoteitm record) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
void insertSelective(Infovoteitm record) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
List<Infovoteitm> selectByExample(InfovoteitmExample example) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
int updateByExampleSelective(Infovoteitm record, InfovoteitmExample example) throws SQLException; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
int updateByExample(Infovoteitm record, InfovoteitmExample example) throws SQLException;
}

InfovoteitmDAOImpl类

package abator.dao;

import abator.model.Infovoteitm;
import abator.model.InfovoteitmExample;
import com.ibatis.sqlmap.client.SqlMapClient;
import java.sql.SQLException;
import java.util.List; public class InfovoteitmDAOImpl implements InfovoteitmDAO {
/**
* This field was generated by Apache iBATIS ibator.
* This field corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
private SqlMapClient sqlMapClient; /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public InfovoteitmDAOImpl(SqlMapClient sqlMapClient) {
super();
this.sqlMapClient = sqlMapClient;
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public int countByExample(InfovoteitmExample example) throws SQLException {
Integer count = (Integer) sqlMapClient.queryForObject("InfoVoteItm.ibatorgenerated_countByExample", example);
return count;
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public int deleteByExample(InfovoteitmExample example) throws SQLException {
int rows = sqlMapClient.delete("InfoVoteItm.ibatorgenerated_deleteByExample", example);
return rows;
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public void insert(Infovoteitm record) throws SQLException {
sqlMapClient.insert("InfoVoteItm.ibatorgenerated_insert", record);
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public void insertSelective(Infovoteitm record) throws SQLException {
sqlMapClient.insert("InfoVoteItm.ibatorgenerated_insertSelective", record);
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
@SuppressWarnings("unchecked")
public List<Infovoteitm> selectByExample(InfovoteitmExample example) throws SQLException {
List<Infovoteitm> list = sqlMapClient.queryForList("InfoVoteItm.ibatorgenerated_selectByExample", example);
return list;
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public int updateByExampleSelective(Infovoteitm record, InfovoteitmExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("InfoVoteItm.ibatorgenerated_updateByExampleSelective", parms);
return rows;
} /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
public int updateByExample(Infovoteitm record, InfovoteitmExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("InfoVoteItm.ibatorgenerated_updateByExample", parms);
return rows;
} /**
* This class was generated by Apache iBATIS ibator.
* This class corresponds to the database table InfoVoteItm
*
* @ibatorgenerated Wed Mar 09 16:57:25 CST 2011
*/
private static class UpdateByExampleParms extends InfovoteitmExample {
private Object record; public UpdateByExampleParms(Object record, InfovoteitmExample example) {
super(example);
this.record = record;
} public Object getRecord() {
return record;
}
}
}

iBATIS代码生成分析的更多相关文章

  1. MyBatis源码分析(一)

    MyBatis故事: 官方网站:http://www.mybatis.org 官方文档:http://www.mybatis.org/mybatis-3/ GitHub:https://github. ...

  2. 使用代码生成工具快速生成基于ABP框架的Vue+Element的前端界面

    世界上唯一不变的东西就是变化,我们通过总结变化的规律,以规律来应付变化,一切事情处理起来事半功倍.我们在开发后端服务代码,前端界面代码的时候,界面都是依照一定的规律进行变化的,我们通过抽取数据库信息, ...

  3. Thrift之TProtocol系列TBinaryProtocol解析

    首先看一下Thrift的整体架构,如下图: 如图所示,黄色部分是用户实现的业务逻辑,褐色部分是根据thrift定义的服务接口描述文件生成的客户端和服务器端代码框架(前篇2中已分析了thrift ser ...

  4. 框架学习:ibatis框架的结构和分析

    由于最近一段时间比较忙碌,<框架学习>系列的文章一直在搁浅着,最近开始继续这个系列的文章更新. 在上篇文章中我们说到了hibernate框架,它是一种基于JDBC的主流持久化框架,是一个优 ...

  5. 【异常及源码分析】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping

    一.异常出现的场景 1)异常出现的SQL @Select("SELECT\n" + " id,discount_type ,min_charge, ${cardFee} ...

  6. [源码分析]从"UDF不应有状态" 切入来剖析Flink SQL代码生成 (修订版)

    [源码分析]从"UDF不应有状态" 切入来剖析Flink SQL代码生成 (修订版) 目录 [源码分析]从"UDF不应有状态" 切入来剖析Flink SQL代码 ...

  7. mybatis-plus报org.apache.ibatis.binding.BindingException分析【转载】

    这个问题整整纠结了我四个多小时,心好累啊...不废话... 背景:Spring整合Mybatis 报错:org.apache.ibatis.binding.BindingException: Inva ...

  8. mybatis源码分析(4)----org.apache.ibatis.binding包

    1.  我们通过接口操作数据库时,发现相关的操作都是在org.apache.ibatis.binding下 从sqSessin 获取getMapper() SqlSession session = s ...

  9. HotSpot模板解释器目标代码生成过程源码分析

    虽然说解释执行模式是逐字逐句翻译给目标平台运行的,但这样的过程未免太过缓慢,如果能把字节码说的话做成纸条,运行时只要把对应的纸条交给目标平台就可以了,这样,执行速度就会明显提升.JVM的Hotspot ...

随机推荐

  1. 【原创】如何在Android Studio下调试原生安卓Framework层面的源代码

    1. Open Existing Android Studio Project. 2. 打开后, Projects -> Android 里面是空的. 这时候,需要选到 Projects-> ...

  2. DELPHI实现百度开放平台

    学习百度语音 百度语音开发平台 http://yuyin.baidu.com/ 百度开发者账号 13600514494,短信登录 应用账号 词语听写 App ID: 7799366 API Key: ...

  3. .net(C#)中结构和类的区别

    static void Main(string[] args) { //类型 //结构:值类型 //类:引用类型 //声明的语法:class struct //在类中,构造函数里,既可以给字段赋值,也 ...

  4. python 实现简单 http 代理

    有台 openwrt 路由器,16M flash存储 + 64M 内存 ,可以装 python .因为没有自带 url 网站访问记录,想手写一个. 原理: http 1.1 也就是 tcp 连接,有 ...

  5. Struts2 基本配置

    Struts2是一个优秀的MVC框架,也是我比较喜欢用的框架.它个各种配置基本都可以集中在一个xml文档中完成.现在让我们看看如何简单几步实现常用功能. 一.搭建Struts2的开发环境 1)首先是利 ...

  6. mysql基础安全

  7. 自己写的java excel导出工具类

    最近项目要用到excel导出功能,之前也写过类似的代码.因为这次项目中多次用到excel导出.这次长了记性整理了一下 分享给大伙 欢迎一起讨论 生成excel的主工具类: public class E ...

  8. Oracle学习笔记(1)----忘记用户名的密码该如何找回

    (1)在连接数据库之前需要打开如下服务: (2)如果忘记用户的密码 I:打开cmd窗口 II:键入命令:connect / as sysdba; III:alter user 用户名 identifi ...

  9. TOAD和PLSQL 默认日期显示、rowid显示、TNSNAME的修改

    先说下要解决的问题: select rowid,acct_id,state_date from acct; 修改后,1)sql指明rowid,可以显示出来 2)时间格式显示为YYYYMMDD HH24 ...

  10. java编程者必收藏的十大学习网站-xiaolanglang123 -

    3S博客 http://blog.3snews.net/space.php?uid=13924628&do=blog&id=70282