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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class io.ebeaninternal.server.core.BeanRequest
createdTransaction, server, transactionFields inherited from interface io.ebeaninternal.api.TxnProfileEventCodes
EVT_CALLABLESQL, EVT_COMMIT, EVT_DELETE, EVT_DELETE_PERMANENT, EVT_DELETE_SOFT, EVT_INSERT, EVT_ORMUPDATE, EVT_ROLLBACK, EVT_UPDATE, EVT_UPDATESQL, FIND_ATTRIBUTE, FIND_ATTRIBUTE_SET, FIND_COUNT, FIND_DELETE, FIND_EXISTS, FIND_ID_LIST, FIND_ITERATE, FIND_MANY, FIND_MANY_LAZY, FIND_ONE, FIND_ONE_LAZY, FIND_SUBQUERY, FIND_UPDATE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTimingBatch(long startNanos, int size) Add timing metrics for batch persist.voidaddTimingNoBatch(long startNanos) abstract intExecute the request right now.abstract intExecute a the request or queue/batch it for later execution.voidbooleanReturn true if this persist request should use JDBC batch.booleanReturn true if this is a queued sql update for element collection or intersection table.booleanReturn true if save and delete should cascade.booleanlogSql()Return true if SQL should be logged for this transaction.booleanReturn true if SUMMARY information should be logged for this transaction.voidReset the transaction depth back to 0.voidstartBind(boolean batchThisRequest) Effectively set start nanos if we are collecting metrics on a label.jakarta.persistence.PersistenceExceptionTranslate the SQLException into a specific exception given the platform.type()Return the type of this request.Methods inherited from class io.ebeaninternal.server.core.BeanRequest
clearTransIfRequired, commitTransIfRequired, createImplicitTransIfRequired, database, dataTimeZone, rollbackTransIfRequired, server, transaction, transactionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.ebeaninternal.server.persist.BatchPostExecute
checkRowCount, postExecute, profile, setGeneratedKey
-
Field Details
-
type
-
label
-
startNanos
protected long startNanos
-
-
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:BatchPostExecuteAdd timing metrics for batch persist.- Specified by:
addTimingBatchin interfaceBatchPostExecute
-
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:BatchPostExecuteReturn 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:
isFlushQueuein interfaceBatchPostExecute
-
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:BeanRequestReturn true if SQL should be logged for this transaction.- Overrides:
logSqlin classBeanRequest
-
logSummary
public boolean logSummary()Description copied from class:BeanRequestReturn true if SUMMARY information should be logged for this transaction.- Overrides:
logSummaryin classBeanRequest
-
isBatchThisRequest
public boolean isBatchThisRequest()Return true if this persist request should use JDBC batch. -
translateSqlException
Translate the SQLException into a specific exception given the platform. -
initTransIfRequired
public void initTransIfRequired() -
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.
-