@Internal public class StoredSqlOperation extends DBOperation
DBOperation that uses bindging paths.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
expandableQuery |
protected java.lang.String[] |
expandableQueryParts |
protected boolean |
isOptimisticLock |
protected SqlQueryBuilder |
queryBuilder |
protected java.util.List<QueryParameterBinding> |
queryParameterBindings |
dialect, query| Modifier | Constructor and Description |
|---|---|
protected |
StoredSqlOperation(SqlQueryBuilder queryBuilder,
java.lang.String query,
java.lang.String[] expandableQueryParts,
java.util.List<QueryParameterBinding> queryParameterBindings,
boolean isOptimisticLock)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
<T> void |
checkForParameterToBeExpanded(RuntimePersistentEntity<T> persistentEntity,
T entity)
Check if query need to be modified to expand parameters.
|
<T> java.util.Map<QueryParameterBinding,java.lang.Object> |
collectAutoPopulatedPreviousValues(RuntimePersistentEntity<T> persistentEntity,
T entity)
Collect auto-populated property values before pre-actions are triggered and property values are modified.
|
SqlQueryBuilder |
getQueryBuilder() |
protected <T> int |
getQueryParameterValueSize(QueryParameterBinding parameter,
RuntimePersistentEntity<T> persistentEntity,
T entity)
Get parameter value size.
|
boolean |
isOptimisticLock()
Return true if query contains previous version check.
|
<T,Cnt,PS> void |
setParameters(OpContext<Cnt,PS> context,
Cnt connection,
PS stmt,
RuntimePersistentEntity<T> persistentEntity,
T entity,
java.util.Map<QueryParameterBinding,java.lang.Object> previousValues)
Set query parameters.
|
protected int |
sizeOf(java.lang.Object value)
Compute the size of the given object.
|
getDialect, getQueryprotected final java.util.List<QueryParameterBinding> queryParameterBindings
protected final boolean isOptimisticLock
protected final java.lang.String[] expandableQueryParts
protected final boolean expandableQuery
protected final SqlQueryBuilder queryBuilder
protected StoredSqlOperation(SqlQueryBuilder queryBuilder, java.lang.String query, @Nullable java.lang.String[] expandableQueryParts, java.util.List<QueryParameterBinding> queryParameterBindings, boolean isOptimisticLock)
queryBuilder - The queryBuilder.query - The queryexpandableQueryParts - The expandableQueryPartsqueryParameterBindings - The query parametersisOptimisticLock - Is optimistic lockingpublic boolean isOptimisticLock()
DBOperationshould be thrown.isOptimisticLock in class DBOperationpublic <T> java.util.Map<QueryParameterBinding,java.lang.Object> collectAutoPopulatedPreviousValues(RuntimePersistentEntity<T> persistentEntity, T entity)
DBOperationcollectAutoPopulatedPreviousValues in class DBOperationT - The entity typepersistentEntity - The persistent entityentity - The entity instancepublic <T> void checkForParameterToBeExpanded(RuntimePersistentEntity<T> persistentEntity, T entity)
T - The entity typepersistentEntity - The persistentEntityentity - The entity instanceprotected <T> int getQueryParameterValueSize(QueryParameterBinding parameter, RuntimePersistentEntity<T> persistentEntity, T entity)
T - The typeparameter - The parameterpersistentEntity - The persistent entityentity - The entity objectpublic <T,Cnt,PS> void setParameters(OpContext<Cnt,PS> context, Cnt connection, PS stmt, RuntimePersistentEntity<T> persistentEntity, T entity, java.util.Map<QueryParameterBinding,java.lang.Object> previousValues)
DBOperationsetParameters in class DBOperationT - The entity typeCnt - The connection typePS - The statement typecontext - The contextconnection - The connectionstmt - The statementpersistentEntity - The persistentEntityentity - The entitypreviousValues - The previous auto-populated collected valuesprotected int sizeOf(java.lang.Object value)
value - The valuepublic SqlQueryBuilder getQueryBuilder()