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(EntityBean bean, Transaction t, boolean permanent) Delete the bean with the explicit transaction.intdelete(Class<?> beanType, Object id, Transaction transaction, boolean permanent) Delete by Id.intdeleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, Transaction transaction, boolean permanent) Delete multiple beans when escalated from a delete query.intdeleteMany(Class<?> beanType, Collection<?> ids, Transaction transaction, boolean permanent) Delete by a List of Id's.int[]executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction) Execute the associated batched statement.intexecuteCallable(CallableSql callSql, Transaction t) Execute the CallableSql.intexecuteOrmUpdate(Update<?> update, Transaction t) Execute the orm update.voidexecuteOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition) Execute or queue the update.intexecuteSqlUpdate(SqlUpdate updSql, Transaction t) Execute the updateSql.intexecuteSqlUpdateNow(SpiSqlUpdate updSql, Transaction t) Execute the SqlUpdate now regardless of transaction batch mode.voidinsert(EntityBean bean, InsertOptions insertOptions, Transaction t) Insert this bean.intmerge(BeanDescriptor<?> desc, EntityBean bean, MergeOptions options, SpiTransaction transaction) Merge the bean.voidsave(EntityBean bean, Transaction t) Insert or update the bean.voidupdate(EntityBean entityBean, Transaction t) Update the bean.voidvisitMetrics(MetricVisitor visitor) Visit the metrics.
-
Constructor Details
-
DefaultPersister
-
-
Method Details
-
visitMetrics
Description copied from interface:PersisterVisit the metrics.- Specified by:
visitMetricsin interfacePersister
-
executeCallable
Execute the CallableSql.- Specified by:
executeCallablein interfacePersister
-
executeOrmUpdate
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
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, EntityBean bean, MergeOptions options, SpiTransaction transaction) Description copied from interface:PersisterMerge the bean. -
update
Update the bean. -
save
Insert or update the bean. -
insert
Insert this bean. -
delete
Delete the bean with the explicit transaction. Return false if the delete is executed without OCC and 0 rows were deleted. -
deleteMany
public int deleteMany(Class<?> beanType, Collection<?> ids, Transaction transaction, boolean permanent) Delete by a List of Id's.- Specified by:
deleteManyin interfacePersister
-
delete
Delete by Id. -
deleteByIds
public int deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, Transaction transaction, boolean permanent) Description copied from interface:PersisterDelete multiple beans when escalated from a delete query.- Specified by:
deleteByIdsin interfacePersister
-