全表查询:
List<Test> tests = testService.list(); // SELECT * FROM T_TEST |
只查询Test中的特定字段:
List<Test> tests = testService.list(Test.T_ID, TEST._VALUE,Test.T_NAME); // SELECT ID, VALUE, NAME FROM T_TEST |
查询从第2条记录开始的5条记录:
List<Test> tests = testService.list(1, 5); // SELECT * FROM T_TEST LIMIT 5 OFFSET 1; |
按表达式查询:
List<Test> tests = testService.list(exp1, exp2, ...); |
按条件查询:
List<Test> tests = testService.list( new Terms().or().and()...); |
按条件排序查询:
List<Test> tests = testService.list( new Terms().or().and()..., new MultiOrder()...); |
按条件排序查询前5条记录:
List<Test> tests = testService.list( new Terms().or().and()..., new MultiOrder()..., 5); |
按条件查询特定列:
List<Test> tests = testService.list( new Names(Test.T_ID, Test.T_NAME), new Terms().or().and()...); |
按条件排序查询特定列:
List<Test> tests = testService.list( new Names(Test.T_ID, Test.T_NAME), new Terms().or().and()..., new MultiOrder()...); |
按条件排序查询特定列前5条记录:
List<Test> tests = testService.list( new Names(Test.T_ID, Test.T_NAME), new Terms().or().and()..., new MultiOrder()..., 5); |
按IQuery查询:
List<Test> tests = testService.list(query); |
按IQuery查询前5条:
List<Test> tests = testService.list(query, 5); |