Interface Persister

All Known Implementing Classes:
DefaultPersister

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

    Modifier and Type
    Method
    Description
    void
    addBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
    Add the statement to JDBC batch for later execution via executeBatch.
    void
    Queue the SqlUpdate for execution with position 0, 1 or 2 defining when it executes relative to the flush of beans .
    int
    delete(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t, boolean permanent)
    Delete the bean.
    int
    delete(Class<?> beanType, Object id, io.ebean.Transaction transaction, boolean permanent)
    Delete a bean given it's type and id value.
    int
    deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, io.ebean.Transaction transaction, boolean permanent)
    Delete multiple beans when escalated from a delete query.
    int
    deleteMany(Class<?> beanType, Collection<?> ids, io.ebean.Transaction transaction, boolean permanent)
    Delete multiple beans given a collection of Id values.
    int[]
    executeBatch(SpiSqlUpdate sqlUpdate, SpiTransaction transaction)
    Execute the associated batched statement.
    int
    executeCallable(io.ebean.CallableSql callable, io.ebean.Transaction t)
    Execute the CallableSql.
    int
    executeOrmUpdate(io.ebean.Update<?> update, io.ebean.Transaction t)
    Execute the Update.
    void
    executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition)
    Execute or queue the update.
    int
    executeSqlUpdate(io.ebean.SqlUpdate update, io.ebean.Transaction t)
    Execute the SqlUpdate (taking into account transaction batch mode).
    int
    executeSqlUpdateNow(SpiSqlUpdate update, io.ebean.Transaction t)
    Execute the SqlUpdate now regardless of transaction batch mode.
    void
    insert(io.ebean.bean.EntityBean entityBean, @Nullable io.ebean.InsertOptions insertOptions, @Nullable io.ebean.Transaction t)
    Perform an Insert using the given bean.
    int
    merge(BeanDescriptor<?> desc, io.ebean.bean.EntityBean entityBean, io.ebean.MergeOptions options, SpiTransaction transaction)
    Merge the bean.
    void
    save(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t)
    Insert or update the bean depending on its state.
    void
    update(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t)
    Update the bean.
    void
    visitMetrics(io.ebean.meta.MetricVisitor visitor)
    Visit the metrics.
  • Method Details

    • merge

      int merge(BeanDescriptor<?> desc, io.ebean.bean.EntityBean entityBean, io.ebean.MergeOptions options, SpiTransaction transaction)
      Merge the bean.
    • update

      void update(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t)
      Update the bean.
    • insert

      void insert(io.ebean.bean.EntityBean entityBean, @Nullable io.ebean.InsertOptions insertOptions, @Nullable io.ebean.Transaction t)
      Perform an Insert using the given bean.
    • save

      void save(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t)
      Insert or update the bean depending on its state.
    • delete

      int delete(Class<?> beanType, Object id, io.ebean.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(io.ebean.bean.EntityBean entityBean, io.ebean.Transaction t, boolean permanent)
      Delete the bean.
    • deleteMany

      int deleteMany(Class<?> beanType, Collection<?> ids, io.ebean.Transaction transaction, boolean permanent)
      Delete multiple beans given a collection of Id values.
    • deleteByIds

      int deleteByIds(BeanDescriptor<?> descriptor, List<Object> idList, io.ebean.Transaction transaction, boolean permanent)
      Delete multiple beans when escalated from a delete query.
    • executeOrmUpdate

      int executeOrmUpdate(io.ebean.Update<?> update, io.ebean.Transaction t)
      Execute the Update.
    • executeSqlUpdate

      int executeSqlUpdate(io.ebean.SqlUpdate update, io.ebean.Transaction t)
      Execute the SqlUpdate (taking into account transaction batch mode).
    • executeSqlUpdateNow

      int executeSqlUpdateNow(SpiSqlUpdate update, io.ebean.Transaction t)
      Execute the SqlUpdate now regardless of transaction batch mode.
    • executeCallable

      int executeCallable(io.ebean.CallableSql callable, io.ebean.Transaction t)
      Execute the CallableSql.
    • visitMetrics

      void visitMetrics(io.ebean.meta.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.