Skip to content

Query Compiling

Siim Kinks edited this page Nov 21, 2016 · 1 revision

Each query can be compiled using the compile() builder method. During compilation final form of SQL is built plus SQL args, observed tables and other metadata is collected. The resulting object is an immutable representation of the defined query. Thanks to its immutability, compiled query object can be shared across threads and executed without any side effects.

import static com.siimkinks.sqlitemagic.AuthorTable.AUTHOR;

CompiledSelect<Author, SelectN> compiledSelect = Select
    .from(AUTHOR)
    .where(AUTHOR.LAST_NAME.like("%Foo%")
    .compile();

See Next

Clone this wiki locally