【发布时间】:2016-08-30 21:51:40
【问题描述】:
我有一个从表中选择人员的查询。
SelectConditionStep<PersonRecord> select = context
.selectFrom(Tables.PERSON)
.where(Tables.PERSON.ISDELETED.eq(false));
if(searchValue != null && searchValue.length() > 0){
select.and(Tables.PERSON.LASTNAME.likeIgnoreCase(String.format("%%%s%%", searchValue)));
}
List<PersonRecord> dbPersons = select
.orderBy(Tables.PERSON.LASTNAME, Tables.PERSON.FIRSTNAME, Tables.PERSON.ID)
.limit(length).offset(start)
.fetch();
这段代码运行良好。因为我在数据表中显示数据,所以我需要具有可选/动态排序功能。到目前为止我还没有找到解决方案。
【问题讨论】: