Class DefaultPersister

java.lang.Object
io.ebeaninternal.server.persist.DefaultPersister
All Implemented Interfaces:
Persister

public final class DefaultPersister extends Object implements 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 Details

  • Method Details

    • visitMetrics

      public void visitMetrics(io.ebean.meta.MetricVisitor visitor)
      Description copied from interface: Persister
      Visit the metrics.
      Specified by:
      visitMetrics in interface Persister
    • executeCallable

      public int executeCallable(io.ebean.CallableSql callSql, io.ebean.Transaction t)
      Execute the CallableSql.
      Specified by:
      executeCallable in interface Persister
    • executeOrmUpdate

      public int executeOrmUpdate(io.ebean.Update<?> update, io.ebean.Transaction t)
      Execute the orm update.
      Specified by:
      executeOrmUpdate in interface Persister
    • addBatch

      public void addBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
      Description copied from interface: Persister
      Add the statement to JDBC batch for later execution via executeBatch.
      Specified by:
      addBatch in interface Persister
    • executeBatch

      public int[] executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
      Description copied from interface: Persister
      Execute the associated batched statement.
      Specified by:
      executeBatch in interface Persister
    • executeOrQueue

      public void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition)
      Description copied from interface: Persister
      Execute or queue the update.
      Specified by:
      executeOrQueue in interface Persister
    • addToFlushQueue

      public void addToFlushQueue(SpiSqlUpdate update, SpiTransaction t, int pos)
      Add to the flush queue in position 0, 1 or 2.
      Specified by:
      addToFlushQueue in interface Persister
    • executeSqlUpdate

      public int executeSqlUpdate(io.ebean.SqlUpdate updSql, io.ebean.Transaction t)
      Execute the updateSql.
      Specified by:
      executeSqlUpdate in interface Persister
    • executeSqlUpdateNow

      public int executeSqlUpdateNow(SpiSqlUpdate updSql, io.ebean.Transaction t)
      Description copied from interface: Persister
      Execute the SqlUpdate now regardless of transaction batch mode.
      Specified by:
      executeSqlUpdateNow in interface Persister
    • merge

      public int merge(BeanDescriptor<?> desc, io.ebean.bean.EntityBean bean, io.ebean.MergeOptions options, SpiTransaction transaction)
      Description copied from interface: Persister
      Merge the bean.
      Specified by:
      merge in interface Persister
    • update

      public void update(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t)
      Update the bean.
      Specified by:
      update in interface Persister
    • save

      public void save(io.ebean.bean.EntityBean bean, io.ebean.Transaction t)
      Insert or update the bean.
      Specified by:
      save in interface Persister
    • insert

      public void insert(io.ebean.bean.EntityBean bean, io.ebean.InsertOptions insertOptions, io.ebean.Transaction t)
      Insert this bean.
      Specified by:
      insert in interface Persister
    • delete

      public int delete(io.ebean.bean.EntityBean bean, io.ebean.Transaction t, boolean permanent)
      Delete the bean with the explicit transaction. Return false if the delete is executed without OCC and 0 rows were deleted.
      Specified by:
      delete in interface Persister
    • deleteMany

      public int deleteMany(Class<?> beanType, Collection<?> ids, io.ebean.Transaction transaction, boolean permanent)
      Delete by a List of Id's.
      Specified by:
      deleteMany in interface Persister
    • delete

      public int delete(Class<?> beanType, Object id, io.ebean.Transaction transaction, boolean permanent)
      Delete by Id.
      Specified by:
      delete in interface Persister
    • deleteByIds

      public int deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, io.ebean.Transaction transaction, boolean permanent)
      Description copied from interface: Persister
      Delete multiple beans when escalated from a delete query.
      Specified by:
      deleteByIds in interface Persister