protected abstract class AbstractSqlRepositoryOperations.SqlOperation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Dialect |
dialect |
protected java.lang.String |
query |
Modifier | Constructor and Description |
---|---|
protected |
SqlOperation(java.lang.String query,
Dialect dialect)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
<T> java.util.Map<java.lang.String,java.lang.Object> |
collectAutoPopulatedPreviousValues(RuntimePersistentEntity<T> persistentEntity,
T entity)
Collect auto-populated property values before pre-actions are triggered and property values are modified.
|
java.lang.String |
exandedQuery()
Expanded query.
|
Dialect |
getDialect()
Get dialect.
|
java.lang.String |
getQuery()
Get sql query.
|
boolean |
isOptimisticLock()
Return true if query contains previous version check.
|
<T> void |
setParameters(PS stmt,
RuntimePersistentEntity<T> persistentEntity,
T entity)
Set query parameters.
|
abstract <T> void |
setParameters(PS stmt,
RuntimePersistentEntity<T> persistentEntity,
T entity,
java.util.Map<java.lang.String,java.lang.Object> previousValues)
Set query parameters.
|
protected java.lang.String query
protected final Dialect dialect
protected SqlOperation(java.lang.String query, Dialect dialect)
query
- The sql querydialect
- The dialectpublic java.lang.String exandedQuery()
public java.lang.String getQuery()
public Dialect getDialect()
public boolean isOptimisticLock()
should be thrown.
public <T> java.util.Map<java.lang.String,java.lang.Object> collectAutoPopulatedPreviousValues(RuntimePersistentEntity<T> persistentEntity, T entity)
T
- The entity typepersistentEntity
- The persistent entityentity
- The entity instancepublic abstract <T> void setParameters(PS stmt, RuntimePersistentEntity<T> persistentEntity, T entity, java.util.Map<java.lang.String,java.lang.Object> previousValues)
T
- The entity typestmt
- The statementpersistentEntity
- The persistentEntityentity
- The entitypreviousValues
- The previous auto-populated collected valuespublic <T> void setParameters(PS stmt, RuntimePersistentEntity<T> persistentEntity, T entity)
T
- The entity typestmt
- The statementpersistentEntity
- The persistentEntityentity
- The entity