Class PersistRequest

java.lang.Object
io.ebeaninternal.server.core.BeanRequest
io.ebeaninternal.server.core.PersistRequest
All Implemented Interfaces:
TxnProfileEventCodes, BatchPostExecute
Direct Known Subclasses:
PersistRequestBean, PersistRequestCallableSql, PersistRequestOrmUpdate, PersistRequestUpdateSql

public abstract class PersistRequest extends BeanRequest implements BatchPostExecute, TxnProfileEventCodes
Wraps all the objects used to persist a bean.
  • Field Details

  • Method Details

    • resetDepth

      public void resetDepth()
      Reset the transaction depth back to 0.
    • addTimingBatch

      public void addTimingBatch(long startNanos, int size)
      Description copied from interface: BatchPostExecute
      Add timing metrics for batch persist.
      Specified by:
      addTimingBatch in interface BatchPostExecute
    • addTimingNoBatch

      public void addTimingNoBatch(long startNanos)
    • startBind

      public void startBind(boolean batchThisRequest)
      Effectively set start nanos if we are collecting metrics on a label.
    • isFlushQueue

      public boolean isFlushQueue()
      Description copied from interface: BatchPostExecute
      Return true if this is a queued sql update for element collection or intersection table. In this case we can executeBatch on the PreparedStatement.
      Specified by:
      isFlushQueue in interface BatchPostExecute
    • executeOrQueue

      public abstract int executeOrQueue()
      Execute a the request or queue/batch it for later execution.
    • executeNow

      public abstract int executeNow()
      Execute the request right now.
    • logSql

      public boolean logSql()
      Description copied from class: BeanRequest
      Return true if SQL should be logged for this transaction.
      Overrides:
      logSql in class BeanRequest
    • logSummary

      public boolean logSummary()
      Description copied from class: BeanRequest
      Return true if SUMMARY information should be logged for this transaction.
      Overrides:
      logSummary in class BeanRequest
    • isBatchThisRequest

      public boolean isBatchThisRequest()
      Return true if this persist request should use JDBC batch.
    • translateSqlException

      public jakarta.persistence.PersistenceException translateSqlException(SQLException e)
      Translate the SQLException into a specific exception given the platform.
    • initTransIfRequired

      public void initTransIfRequired()
    • type

      public PersistRequest.Type type()
      Return the type of this request. One of INSERT, UPDATE, DELETE, UPDATESQL or CALLABLESQL.
    • isPersistCascade

      public boolean isPersistCascade()
      Return true if save and delete should cascade.