Interface Persister

All Known Implementing Classes:
DefaultPersister

public interface Persister
API for persisting a bean.
  • Method Details

    • 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, @Nullable InsertOptions insertOptions, @Nullable Transaction t)
      Perform 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.
    • visitMetrics

      void visitMetrics(MetricVisitor visitor)
      Visit the metrics.
    • executeOrQueue

      void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition)
      Execute or queue the update.
    • addToFlushQueue

      void addToFlushQueue(SpiSqlUpdate update, SpiTransaction t, int pos)
      Queue the SqlUpdate for execution with position 0, 1 or 2 defining when it executes relative to the flush of beans .
    • 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.