E
- the generic type of entities to insert with this querypublic class InsertQuery<E extends SQLEntity> extends BatchQuery<E>
avarage, batchBacklog, batchBacklogLimit, context, descriptor, mappings, MAX_BATCH_BACKLOG, mixing, oma, properties, query, stmt, type
Modifier | Constructor and Description |
---|---|
protected |
InsertQuery(BatchContext context,
Class<E> type,
boolean fetchId,
String[] mappings) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildSQL()
Determines the SQL statement to prepare in
BatchQuery.prepareStmt() . |
protected List<Property> |
getProperties()
Transforms the mappings into a list of properties.
|
void |
insert(E entity,
boolean invokeChecks,
boolean addBatch)
Inserts an entity into the database.
|
addBatch, close, commit, createStmt, getDescriptor, prepareStmt, safeClose, toString, tryCommit, withCustomBatchLimit
protected InsertQuery(BatchContext context, Class<E> type, boolean fetchId, String[] mappings)
public void insert(@Nonnull E entity, boolean invokeChecks, boolean addBatch)
entity
- the entity to insertinvokeChecks
- determines if before- and after save checks should be performed (true) or
skipped (false)addBatch
- determines if the query should be executed instantly (false) or added to the
batch update (true).protected List<Property> getProperties()
BatchQuery
getProperties
in class BatchQuery<E extends SQLEntity>
protected 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.