Package io.ebeaninternal.server.core
Interface Persister
-
- All Known Implementing Classes:
DefaultPersister
public interface Persister
API for persisting a bean.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
Add the statement to JDBC batch for later execution via executeBatch.void
addToFlushQueue(SpiSqlUpdate update, SpiTransaction t)
Queue the SqlUpdate for early execution (with JDBC batch).void
addToFlushQueueLast(SpiSqlUpdate update, SpiTransaction t)
Queue the SqlUpdate for late execution (with JDBC batch).int
delete(EntityBean entityBean, Transaction t, boolean permanent)
Delete the bean.int
delete(Class<?> beanType, Object id, Transaction transaction, boolean permanent)
Delete a bean given it's type and id value.int
deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, Transaction transaction, boolean permanent)
Delete multiple beans when escalated from a delete query.int
deleteMany(Class<?> beanType, Collection<?> ids, Transaction transaction, boolean permanent)
Delete multiple beans given a collection of Id values.<T> List<T>
draftRestore(Query<T> query, Transaction transaction)
Restore the draft beans back to the matching live beans.int[]
executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
Execute the associated batched statement.int
executeCallable(CallableSql callable, Transaction t)
Execute the CallableSql.int
executeOrmUpdate(Update<?> update, Transaction t)
Execute the Update.void
executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue)
Execute or queue the update.int
executeSqlUpdate(SqlUpdate update, Transaction t)
Execute the SqlUpdate (taking into account transaction batch mode).int
executeSqlUpdateNow(SpiSqlUpdate update, Transaction t)
Execute the SqlUpdate now regardless of transaction batch mode.void
insert(EntityBean entityBean, Transaction t)
Force an Insert using the given bean.int
merge(BeanDescriptor<?> desc, EntityBean entityBean, MergeOptions options, SpiTransaction transaction)
Merge the bean.<T> List<T>
publish(Query<T> query, Transaction transaction)
Publish the draft beans matching the given query.void
save(EntityBean entityBean, Transaction t)
Insert or update the bean depending on its state.void
update(EntityBean entityBean, Transaction t)
Update the bean.void
visitMetrics(MetricVisitor visitor)
Visit the metrics.
-
-
-
Method Detail
-
merge
int merge(BeanDescriptor<?> desc, EntityBean entityBean, MergeOptions options, SpiTransaction transaction)
Merge the bean.
-
update
void update(EntityBean entityBean, Transaction t)
Update the bean.
-
insert
void insert(EntityBean entityBean, Transaction t)
Force an Insert using the given bean.
-
save
void save(EntityBean entityBean, Transaction t)
Insert or update the bean depending on its state.
-
delete
int delete(Class<?> beanType, Object id, Transaction transaction, boolean permanent)
Delete a bean given it's type and id value.This will also cascade delete one level of children.
-
delete
int delete(EntityBean entityBean, Transaction t, boolean permanent)
Delete the bean.
-
deleteMany
int deleteMany(Class<?> beanType, Collection<?> ids, Transaction transaction, boolean permanent)
Delete multiple beans given a collection of Id values.
-
deleteByIds
int deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, Transaction transaction, boolean permanent)
Delete multiple beans when escalated from a delete query.
-
executeOrmUpdate
int executeOrmUpdate(Update<?> update, Transaction t)
Execute the Update.
-
executeSqlUpdate
int executeSqlUpdate(SqlUpdate update, Transaction t)
Execute the SqlUpdate (taking into account transaction batch mode).
-
executeSqlUpdateNow
int executeSqlUpdateNow(SpiSqlUpdate update, Transaction t)
Execute the SqlUpdate now regardless of transaction batch mode.
-
executeCallable
int executeCallable(CallableSql callable, Transaction t)
Execute the CallableSql.
-
publish
<T> List<T> publish(Query<T> query, Transaction transaction)
Publish the draft beans matching the given query.
-
draftRestore
<T> List<T> draftRestore(Query<T> query, Transaction transaction)
Restore the draft beans back to the matching live beans.
-
visitMetrics
void visitMetrics(MetricVisitor visitor)
Visit the metrics.
-
executeOrQueue
void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue)
Execute or queue the update.
-
addToFlushQueue
void addToFlushQueue(SpiSqlUpdate update, SpiTransaction t)
Queue the SqlUpdate for early execution (with JDBC batch).
-
addToFlushQueueLast
void addToFlushQueueLast(SpiSqlUpdate update, SpiTransaction t)
Queue the SqlUpdate for late execution (with JDBC batch).
-
addBatch
void addBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
Add the statement to JDBC batch for later execution via executeBatch.
-
executeBatch
int[] executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
Execute the associated batched statement.
-
-