E
- the generic type of entities to find with this querypublic class FindQuery<E extends SQLEntity> extends BatchQuery<E>
A query is created by enumerating which mappings to compare in order to identify the entity. The query is then supplied with an example entity from which the search values are derived.
avarage, batchBacklog, batchBacklogLimit, context, descriptor, mappings, MAX_BATCH_BACKLOG, mixing, oma, properties, query, stmt, type
Modifier | Constructor and Description |
---|---|
protected |
FindQuery(BatchContext context,
Class<E> type,
String[] mappings) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildSQL()
Determines the SQL statement to prepare in
BatchQuery.prepareStmt() . |
Optional<E> |
find(E example)
Tries to find a real database entity where the mappings to compare match the given example entity.
|
addBatch, close, commit, createStmt, getDescriptor, getProperties, prepareStmt, safeClose, toString, tryCommit, withCustomBatchLimit
protected FindQuery(BatchContext context, Class<E> type, String[] mappings)
@Nonnull public Optional<E> find(@Nonnull E example)
example
- the example entity to search byprotected void buildSQL() throws SQLException
BatchQuery
BatchQuery.prepareStmt()
.buildSQL
in class BatchQuery<E extends SQLEntity>
SQLException
- in case of a database errorCopyright © 2018. All rights reserved.