@Options(resultSetType=ResultSetType.SCROLL_INSENSITIVE)
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="country", property="country", jdbcType=JdbcType.VARCHAR),
@Result(column="area", property="area", jdbcType=JdbcType.VARCHAR),
@Result(column="vessel", property="vessel", jdbcType=JdbcType.VARCHAR),
@Result(column="year", property="year", jdbcType=JdbcType.SMALLINT),
@Result(column="haul_number", property="haulNumber", jdbcType=JdbcType.NUMERIC),
@Result(column="codend_closing", property="codendClosing", jdbcType=JdbcType.CHAR),
@Result(column="partit", property="partit", jdbcType=JdbcType.CHAR),
@Result(column="genus", property="genus", jdbcType=JdbcType.VARCHAR),
@Result(column="species", property="species", jdbcType=JdbcType.VARCHAR),
@Result(column="codlon", property="codlon", jdbcType=JdbcType.CHAR),
@Result(column="pfrac", property="pfrac", jdbcType=JdbcType.NUMERIC),
@Result(column="pechan", property="pechan", jdbcType=JdbcType.NUMERIC),
@Result(column="sex", property="sex", jdbcType=JdbcType.CHAR),
@Result(column="nbsex", property="nbsex", jdbcType=JdbcType.NUMERIC),
@Result(column="length_class", property="lengthClass", jdbcType=JdbcType.NUMERIC),
@Result(column="maturity", property="maturity", jdbcType=JdbcType.VARCHAR),
@Result(column="nblon", property="nblon", jdbcType=JdbcType.NUMERIC),
@Result(column="matsub", property="matsub", jdbcType=JdbcType.VARCHAR),
@Result(column="tf", property="tf", jdbcType=JdbcType.VARCHAR),
@Result(column="month", property="month", jdbcType=JdbcType.SMALLINT),
@Result(column="day", property="day", jdbcType=JdbcType.SMALLINT),
@Result(column="catfau", property="catfau", jdbcType=JdbcType.VARCHAR),
@Result(column="upload_id", property="uploadId", jdbcType=JdbcType.SMALLINT)
})
List<med.database.model.TMeditsTc> selectPage(RowBounds bounds);
15:19:35,242 DEBUG [selectPage:159] ==> Preparing: select id, country, area, vessel, year, haul_number, codend_closing, partit, genus, species, codlon, pfrac, pechan, sex, nbsex, length_class, maturity, nblon, matsub, tf, month, day, catfau, upload_id from upload.t_medits_tc
select id, country, area, vessel, year, haul_number, codend_closing, partit, genus, species, codlon, pfrac, pechan, sex, nbsex, length_class, maturity, nblon, matsub, tf, month, day, catfau, upload_id from upload.t_medits_tc limit {1} offset {2}
The RowBounds parameter causes MyBatis to skip the number of records specified, as well as limit the number of results returned to some number. The RowBounds class has a constructor to take both the offset and limit, and is otherwise immutable.
int offset = 100; int limit = 25; RowBounds rowBounds = new RowBounds(offset, limit);
Different drivers are able to achieve different levels of efficiency in this regard. For the best performance, use result set types of SCROLL_SENSITIVE or SCROLL_INSENSITIVE (in other words: not FORWARD_ONLY).
@Select("SELECT ... FROM ... WHERE ... LIMIT ${limit} OFFSET ${offset}")
List<med.database.model.TMeditsTc> selectPage(@Param("offset") offset, @Param("limit") int limit);
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.