Skip to content
redraiment edited this page Jun 2, 2014 · 1 revision

Here is the list of query of Table:

  • Record find(int id): query the record by id.
  • List<Record> all(): returns all records with foreign key constraint.
  • List<Record> paging(int page, int size): paging query base on all(), the page number from 0.
  • Record first(): base on all(), returns the first record in id asc order.
  • Record last(): base on all(), returns the last record in id asc order.
  • List<Record> where(String condition, Object... args): base on all(), returns all records matching gaven condition which compatible with java.sql.PreparedStatement.
  • Record first(String condition, Object... args): base on where(), returns the first record in id asc order.
  • Record last(String condition, Object... args): base on where(), returns the last record in id asc order.
  • List<Record> findBy(String key, Object value): base on all(), returns the records that the column equals the gaven value.
  • Record findA(String key, Object value): base on findBy(), returns the first record only.

first, last, find etc. return one record only, while some other methods would return more than one records, so that they return a List rather than a record.