1.利用generator生成java bean和example。
2.修建example配置文件,在selectExample当中添加分页符,例如
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.myflex.platform.model.UsersExample" > select <if test="distinct" > distinct </if> <include refid="Base_Column_List" /> from users <if test="_parameter != null" > <include refid="Example_Where_Clause" /> </if> <if test="orderByClause != null" > order by ${orderByClause} </if> <if test="start !=0 or limit!=0">limit #{start},#{limit}</if> </select>
编写baseExample,如下
package com.myflex.platform.model;
public class BaseExample {
private int start;
private int limit;
public int getStart() {
return start;
}
public void setStart(int start) {
this.start = start;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
}
3.java bean继承序列化接口