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 Object
Synchronous cascade operations.
Since:
3.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    The cascade operations helper.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SyncCascadeOperations(io.micronaut.core.convert.ConversionService conversionService, SyncCascadeOperations.SyncCascadeOperationsHelper<Ctx> helper)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <T> T
    afterCascadedMany(T entity, List<io.micronaut.data.model.Association> associations, Iterable<Object> prevChildren, List<Object> newChildren)
    Process after a children element has been cascaded.
    protected <T> T
    afterCascadedOne(T entity, List<io.micronaut.data.model.Association> associations, Object prevChild, Object newChild)
    Process after a child element has been cascaded.
    protected <T> void
    cascade(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Class<?> repositoryType, boolean fkOnly, io.micronaut.data.annotation.Relation.Cascade cascadeType, io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeContext ctx, io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, T entity, List<io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeOp> cascadeOps)
    Cascade on the entity instance and collect cascade operations.
    <T> T
    cascadeEntity(Ctx ctx, T entity, io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, boolean isPost, io.micronaut.data.annotation.Relation.Cascade cascadeType)
    Cascade the entity operation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SyncCascadeOperations

      public SyncCascadeOperations(io.micronaut.core.convert.ConversionService conversionService, SyncCascadeOperations.SyncCascadeOperationsHelper<Ctx> helper)
      Default constructor.
      Parameters:
      conversionService - The conversionService
      helper - The helper
  • Method Details

    • cascadeEntity

      public <T> T cascadeEntity(Ctx ctx, T entity, io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, boolean isPost, io.micronaut.data.annotation.Relation.Cascade cascadeType)
      Cascade the entity operation.
      Type Parameters:
      T - The entity type
      Parameters:
      ctx - The context
      entity - The entity instance
      persistentEntity - The persistent entity
      isPost - Is post cascade?
      cascadeType - The cascade type
      Returns:
      The entity instance
    • cascade

      protected <T> void cascade(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Class<?> repositoryType, boolean fkOnly, io.micronaut.data.annotation.Relation.Cascade cascadeType, io.micronaut.data.runtime.operations.internal.AbstractCascadeOperations.CascadeContext ctx, io.micronaut.data.model.runtime.RuntimePersistentEntity<T> persistentEntity, T entity, 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 annotationMetadata
      repositoryType - The repositoryType
      fkOnly - Is FK only
      cascadeType - The cascadeType
      ctx - The cascade context
      persistentEntity - The persistent entity
      entity - The entity instance
      cascadeOps - The cascade operations
    • afterCascadedOne

      protected <T> T afterCascadedOne(T entity, List<io.micronaut.data.model.Association> associations, Object prevChild, 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 child
      prevChild - The previous child value
      newChild - The new child value
      Returns:
      The entity instance
    • afterCascadedMany

      protected <T> T afterCascadedMany(T entity, List<io.micronaut.data.model.Association> associations, Iterable<Object> prevChildren, List<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 child
      prevChildren - The previous children value
      newChildren - The new children value
      Returns:
      The entity instance