// select
// note that the Date object and the boolean value are used "as is"
Date date = new GregorianCalendar(1980, 1, 1).getTime();
table.select().where(BIRTHDAY).greaterThan(date).and(MARRIED).equalsTo(true).orderBy(NAME, Order.ASCENDING).limit(100).offset(200).execute();
// delete 100 oldest rows
table.delete().orderBy(TIMESTAMP, Order.ASCENDING).limit(100).execute();
// delete data corresponding to objects
table.delete(object1, object2);
// increase values in database
table.update().addValue(COUNT, 5).execute()
// update data corresponding to objects
table.update(object1, object2, object3).setValue(FINE, 0).execute();
// count rows
int count = table.inspectData().where(AGE).greaterThan(19).count();
// check if data exists
boolean exists = table.inspectData().where(AGE).greaterThan(19).exists();
// get largest value
long lastTimestamp = table.inspectData().getLargestValueOf(TIMESTAMP, Long.class);
// SELECT * FROM persons WHERE id IN (SELECT person_id FROM fines)
personsTable.select().where(ID).in(finesTable.columnValues(PERSON_ID)).execute();
// select unique values of column
table.select(COUNTRY).distinct().execute();
// select the single function result
int totalSalaryOfMarketingDepartment = table.select(Result.of(Function.TOTAL, SALARY), Integer.class).groupBy(DEPARTMENT).where(DEPARTMENT).equalsTo("marketing").executeSingle();
// map values of one column to corresponding values of another column
Map<String, String> map = table.map(TITLE, String.class).to(AUTHOR, String.class).execute();
// map to aggregated values
Map<String, String> map = table.map(AUTHOR, String.class).to(Result.of(Function.COUNT)).execute();
// map one column to the list of corresponding values of another column
Map<String, List<String>> map = table.map(AUTHOR, String.class).toListOf(TITLE, String.class).execute();
// read objects into a map which maps an id to the object
Map<Long, Book> map = table.map(ID, Long.class).toModel().execute();
// group objects by value of some column
Map<String, List<Book>> map = table.map(AUTHOR, String.class).toListOfModels().execute();