Class DefaultPersister
java.lang.Object
io.ebeaninternal.server.persist.DefaultPersister
- All Implemented Interfaces:
Persister
Persister implementation using DML.
This object uses DmlPersistExecute to perform the actual persist execution.
This object:
- Determines insert or update for saved beans
- Determines the concurrency mode
- Handles cascading of save and delete
- Handles the batching and queueing
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPersister(SpiEbeanServer server, Binder binder, BeanDescriptorManager descMgr) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction) Add the statement to JDBC batch for later execution via executeBatch.voidaddToFlushQueue(SpiSqlUpdate update, SpiTransaction t, int pos) Add to the flush queue in position 0, 1 or 2.intdelete(io.ebean.bean.EntityBean bean, io.ebean.Transaction t, boolean permanent) Delete the bean with the explicit transaction.intDelete by Id.intdeleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, io.ebean.Transaction transaction, boolean permanent) Delete multiple beans when escalated from a delete query.intdeleteMany(Class<?> beanType, Collection<?> ids, io.ebean.Transaction transaction, boolean permanent) Delete by a List of Id's.int[]executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction) Execute the associated batched statement.intexecuteCallable(io.ebean.CallableSql callSql, io.ebean.Transaction t) Execute the CallableSql.intexecuteOrmUpdate(io.ebean.Update<?> update, io.ebean.Transaction t) Execute the orm update.voidexecuteOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition) Execute or queue the update.intexecuteSqlUpdate(io.ebean.SqlUpdate updSql, io.ebean.Transaction t) Execute the updateSql.intexecuteSqlUpdateNow(SpiSqlUpdate updSql, io.ebean.Transaction t) Execute the SqlUpdate now regardless of transaction batch mode.voidinsert(io.ebean.bean.EntityBean bean, io.ebean.InsertOptions insertOptions, io.ebean.Transaction t) Insert this bean.intmerge(BeanDescriptor<?> desc, io.ebean.bean.EntityBean bean, io.ebean.MergeOptions options, SpiTransaction transaction) Merge the bean.voidsave(io.ebean.bean.EntityBean bean, io.ebean.Transaction t) Insert or update the bean.voidupdate(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t) Update the bean.voidvisitMetrics(io.ebean.meta.MetricVisitor visitor) Visit the metrics.
-
Constructor Details
-
DefaultPersister
-
-
Method Details
-
visitMetrics
public void visitMetrics(io.ebean.meta.MetricVisitor visitor) Description copied from interface:PersisterVisit the metrics.- Specified by:
visitMetricsin interfacePersister
-
executeCallable
public int executeCallable(io.ebean.CallableSql callSql, io.ebean.Transaction t) Execute the CallableSql.- Specified by:
executeCallablein interfacePersister
-
executeOrmUpdate
public int executeOrmUpdate(io.ebean.Update<?> update, io.ebean.Transaction t) Execute the orm update.- Specified by:
executeOrmUpdatein interfacePersister
-
addBatch
Description copied from interface:PersisterAdd the statement to JDBC batch for later execution via executeBatch. -
executeBatch
Description copied from interface:PersisterExecute the associated batched statement.- Specified by:
executeBatchin interfacePersister
-
executeOrQueue
Description copied from interface:PersisterExecute or queue the update.- Specified by:
executeOrQueuein interfacePersister
-
addToFlushQueue
Add to the flush queue in position 0, 1 or 2.- Specified by:
addToFlushQueuein interfacePersister
-
executeSqlUpdate
public int executeSqlUpdate(io.ebean.SqlUpdate updSql, io.ebean.Transaction t) Execute the updateSql.- Specified by:
executeSqlUpdatein interfacePersister
-
executeSqlUpdateNow
Description copied from interface:PersisterExecute the SqlUpdate now regardless of transaction batch mode.- Specified by:
executeSqlUpdateNowin interfacePersister
-
merge
public int merge(BeanDescriptor<?> desc, io.ebean.bean.EntityBean bean, io.ebean.MergeOptions options, SpiTransaction transaction) Description copied from interface:PersisterMerge the bean. -
update
-
save
-
insert
-
delete
-
deleteMany
public int deleteMany(Class<?> beanType, Collection<?> ids, io.ebean.Transaction transaction, boolean permanent) Delete by a List of Id's.- Specified by:
deleteManyin interfacePersister
-
delete
-
deleteByIds
public int deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, io.ebean.Transaction transaction, boolean permanent) Description copied from interface:PersisterDelete multiple beans when escalated from a delete query.- Specified by:
deleteByIdsin interfacePersister
-