Class EntityMutationDataFetcher

java.lang.Object
io.jmix.graphql.datafetcher.EntityMutationDataFetcher

@Component("gql_EntityMutationDataFetcher") public class EntityMutationDataFetcher extends Object
  • Field Details

  • Constructor Details

    • EntityMutationDataFetcher

      public EntityMutationDataFetcher()
  • Method Details

    • upsertEntity

      public graphql.schema.DataFetcher<?> upsertEntity(MetaClass metaClass)
    • deleteEntity

      public graphql.schema.DataFetcher<?> deleteEntity(MetaClass metaClass)
    • getMainEntity

      protected Object getMainEntity(Collection<Object> importedEntities, MetaClass metaClass)
    • checkCanDeleteEntity

      protected void checkCanDeleteEntity(MetaClass metaClass)
    • checkReadOnlyAttributeWrite

      protected void checkReadOnlyAttributeWrite(MetaClass metaClass, EntityImportPlan importPlan, Object entity)
    • populateAndCheckComposition

      protected void populateAndCheckComposition(Object entity, Set<Object> visited)
      Walk through entity graph and check that all compositions have correct relations. If composition inverse value is null - update it to correct value. If composition inverse value doesn't match parent - throw exception.
      Parameters:
      entity - entity to be checked
      visited - a set of entities that already be checked in graph
    • assureCompositionInverseLink

      protected void assureCompositionInverseLink(Object parent, MetaClass parentMetaClass, MetaProperty metaProperty, Object child)
      Check that inverse link is set correctly in composition relation. If link is null - fix it (assign to parent). If link point to different entity (not equals to parent) - throw exception.
      Parameters:
      parent - - parent entity
      parentMetaClass - - meta class of parent entity
      metaProperty - - metadata of property which points to child in parent entity
      child - - child entity