T
- The entity typeprotected abstract class AbstractSqlRepositoryOperations.BaseOperations<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected RuntimePersistentEntity<T> |
persistentEntity |
Modifier | Constructor and Description |
---|---|
protected |
BaseOperations(RuntimePersistentEntity<T> persistentEntity) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cascadePost(Relation.Cascade cascadeType,
Cnt cnt,
Dialect dialect,
io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
java.lang.Class<?> repositoryType,
java.util.List<Association> associations,
java.util.Set<java.lang.Object> persisted)
Cascade post operation.
|
protected abstract void |
cascadePre(Relation.Cascade cascadeType,
Cnt cnt,
Dialect dialect,
io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
java.lang.Class<?> repositoryType,
java.util.List<Association> associations,
java.util.Set<java.lang.Object> persisted)
Cascade pre operation.
|
protected void |
checkForParameterToBeExpanded(AbstractSqlRepositoryOperations.SqlOperation sqlOperation,
SqlQueryBuilder queryBuilder)
Delegate to SQL operation to check if query needs to be changed to allow for expanded parameters.
|
protected abstract void |
collectAutoPopulatedPreviousValues(AbstractSqlRepositoryOperations.SqlOperation sqlOperation)
Collect auto populated values before pre-triggers modifies them.
|
protected abstract void |
executeUpdate(PS stmt)
Execute update.
|
protected abstract void |
executeUpdate(PS stmt,
AbstractSqlRepositoryOperations.DBOperation2<java.lang.Integer,java.lang.Integer,Exc> fn)
Execute update and process entities modified and rows executed.
|
protected abstract void |
executeUpdateSetGeneratedId(PS stmt)
Execute update and update generated id.
|
protected abstract void |
setParameters(PS stmt,
AbstractSqlRepositoryOperations.SqlOperation sqlOperation)
Set sql parameters.
|
protected abstract void |
triggerPost(java.util.function.Consumer<EntityEventContext<java.lang.Object>> fn)
Trigger post-actions on
EntityEventContext . |
protected void |
triggerPostPersist()
Trigger the post persist event.
|
protected void |
triggerPostRemove()
Trigger the post remove event.
|
protected void |
triggerPostUpdate()
Trigger the post update event.
|
protected abstract boolean |
triggerPre(java.util.function.Function<EntityEventContext<java.lang.Object>,java.lang.Boolean> fn)
Trigger pre-actions on
EntityEventContext . |
protected boolean |
triggerPrePersist()
Trigger the pre persist event.
|
protected boolean |
triggerPreRemove()
Trigger the pre remove event.
|
protected boolean |
triggerPreUpdate()
Trigger the pre update event.
|
protected T |
updateEntityId(io.micronaut.core.beans.BeanProperty<T,java.lang.Object> identity,
T entity,
java.lang.Object id)
Update entity id.
|
protected abstract void |
veto(java.util.function.Predicate<T> predicate)
Veto an entity.
|
protected final RuntimePersistentEntity<T> persistentEntity
protected BaseOperations(RuntimePersistentEntity<T> persistentEntity)
protected abstract void cascadePre(Relation.Cascade cascadeType, Cnt cnt, Dialect dialect, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.Class<?> repositoryType, java.util.List<Association> associations, java.util.Set<java.lang.Object> persisted)
cascadeType
- The cascade typecnt
- The connectiondialect
- The dialectannotationMetadata
- The annotation metadatarepositoryType
- The repository typeassociations
- The associations leading to the entitypersisted
- The set containing previously processed valuesprotected abstract void cascadePost(Relation.Cascade cascadeType, Cnt cnt, Dialect dialect, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.Class<?> repositoryType, java.util.List<Association> associations, java.util.Set<java.lang.Object> persisted)
cascadeType
- The cascade typecnt
- The connectiondialect
- The dialectannotationMetadata
- The annotation metadatarepositoryType
- The repository typeassociations
- The associations leading to the entitypersisted
- The set containing previously processed valuesprotected abstract void collectAutoPopulatedPreviousValues(AbstractSqlRepositoryOperations.SqlOperation sqlOperation)
sqlOperation
- The sql operationprotected void checkForParameterToBeExpanded(AbstractSqlRepositoryOperations.SqlOperation sqlOperation, SqlQueryBuilder queryBuilder)
sqlOperation
- The sqlOperationqueryBuilder
- The queryBuilderprotected abstract void setParameters(PS stmt, AbstractSqlRepositoryOperations.SqlOperation sqlOperation) throws Exc extends java.lang.Exception
stmt
- The statementsqlOperation
- The sql operationExc
- The exception typeExc extends java.lang.Exception
protected abstract void executeUpdate(PS stmt, AbstractSqlRepositoryOperations.DBOperation2<java.lang.Integer,java.lang.Integer,Exc> fn) throws Exc extends java.lang.Exception
stmt
- The statementfn
- The functionExc
- The exception typeExc extends java.lang.Exception
protected abstract void executeUpdate(PS stmt) throws Exc extends java.lang.Exception
stmt
- The statementExc
- The exception typeExc extends java.lang.Exception
protected abstract void executeUpdateSetGeneratedId(PS stmt) throws Exc extends java.lang.Exception
stmt
- The statementExc
- The exception typeExc extends java.lang.Exception
protected abstract void veto(java.util.function.Predicate<T> predicate)
predicate
- The veto predicateprotected T updateEntityId(io.micronaut.core.beans.BeanProperty<T,java.lang.Object> identity, T entity, java.lang.Object id)
identity
- The identity property.entity
- The entity instanceid
- The id instanceprotected boolean triggerPrePersist()
protected boolean triggerPreUpdate()
protected boolean triggerPreRemove()
protected void triggerPostUpdate()
protected void triggerPostRemove()
protected void triggerPostPersist()
protected abstract boolean triggerPre(java.util.function.Function<EntityEventContext<java.lang.Object>,java.lang.Boolean> fn)
EntityEventContext
.fn
- The entity context functionprotected abstract void triggerPost(java.util.function.Consumer<EntityEventContext<java.lang.Object>> fn)
EntityEventContext
.fn
- The entity context function