Class SyncCascadeOperations<Ctx extends OperationContext>
- java.lang.Object
-
- io.micronaut.data.runtime.operations.internal.SyncCascadeOperations<Ctx>
-
- Type Parameters:
Ctx- The operation context.
@Internal public final class SyncCascadeOperations<Ctx extends OperationContext> extends java.lang.ObjectSynchronous cascade operations.- Since:
- 3.3
- Author:
- Denis Stepanov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSyncCascadeOperations.SyncCascadeOperationsHelper<Ctx extends OperationContext>The cascade operations helper.
-
Constructor Summary
Constructors Constructor Description SyncCascadeOperations(io.micronaut.core.convert.ConversionService<?> conversionService, SyncCascadeOperations.SyncCascadeOperationsHelper<Ctx> helper)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> TafterCascadedMany(T entity, java.util.List<Association> associations, java.lang.Iterable<java.lang.Object> prevChildren, java.util.List<java.lang.Object> newChildren)Process after a children element has been cascaded.protected <T> TafterCascadedOne(T entity, java.util.List<Association> associations, java.lang.Object prevChild, java.lang.Object newChild)Process after a child element has been cascaded.protected <T> voidcascade(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.Class<?> repositoryType, boolean fkOnly, Relation.Cascade cascadeType, io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeContext ctx, RuntimePersistentEntity<T> persistentEntity, T entity, java.util.List<io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeOp> cascadeOps)Cascade on the entity instance and collect cascade operations.<T> TcascadeEntity(Ctx ctx, T entity, RuntimePersistentEntity<T> persistentEntity, boolean isPost, Relation.Cascade cascadeType)Cascade the entity operation.
-
-
-
Constructor Detail
-
SyncCascadeOperations
public SyncCascadeOperations(io.micronaut.core.convert.ConversionService<?> conversionService, SyncCascadeOperations.SyncCascadeOperationsHelper<Ctx> helper)Default constructor.- Parameters:
conversionService- The conversionServicehelper- The helper
-
-
Method Detail
-
cascadeEntity
public <T> T cascadeEntity(Ctx ctx, T entity, RuntimePersistentEntity<T> persistentEntity, boolean isPost, Relation.Cascade cascadeType)
Cascade the entity operation.- Type Parameters:
T- The entity type- Parameters:
ctx- The contextentity- The entity instancepersistentEntity- The persistent entityisPost- Is post cascade?cascadeType- The cascade type- Returns:
- The entity instance
-
cascade
protected <T> void cascade(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.Class<?> repositoryType, boolean fkOnly, Relation.Cascade cascadeType, io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeContext ctx, RuntimePersistentEntity<T> persistentEntity, T entity, java.util.List<io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeOp> cascadeOps)Cascade on the entity instance and collect cascade operations.- Type Parameters:
T- The entity type- Parameters:
annotationMetadata- The annotationMetadatarepositoryType- The repositoryTypefkOnly- Is FK onlycascadeType- The cascadeTypectx- The cascade contextpersistentEntity- The persistent entityentity- The entity instancecascadeOps- The cascade operations
-
afterCascadedOne
protected <T> T afterCascadedOne(T entity, java.util.List<Association> associations, java.lang.Object prevChild, java.lang.Object newChild)Process after a child element has been cascaded.- Type Parameters:
T- The entity type- Parameters:
entity- The parent entity.associations- The association leading to the childprevChild- The previous child valuenewChild- The new child value- Returns:
- The entity instance
-
afterCascadedMany
protected <T> T afterCascadedMany(T entity, java.util.List<Association> associations, java.lang.Iterable<java.lang.Object> prevChildren, java.util.List<java.lang.Object> newChildren)Process after a children element has been cascaded.- Type Parameters:
T- The entity type- Parameters:
entity- The parent entity.associations- The association leading to the childprevChildren- The previous children valuenewChildren- The new children value- Returns:
- The entity instance
-
-