Class EntityManager

java.lang.Object
step.core.entities.EntityManager

public class EntityManager extends Object
  • Field Details

  • Constructor Details

    • EntityManager

      public EntityManager()
  • Method Details

    • register

      public EntityManager register(Entity<?,?> entity)
    • getEntities

      public Collection<Entity<?,?>> getEntities()
    • getEntityByName

      public Entity<?,?> getEntityByName(String entityName)
    • resolveClass

      public Class<?> resolveClass(String entityName)
    • getEntitiesReferences

      public void getEntitiesReferences(String entityType, step.core.objectenricher.ObjectPredicate objectPredicate, boolean recursively, EntityReferencesMap refs)
      Retrieve all existing references from the DB for given entity type
      Parameters:
      entityType - type of entities to retrieve
      objectPredicate - to apply to filter entities (i.e. project)
      recursively - flag to export references recursively (i.e by exporting a plan recursively the plan will be scanned to find sub references)
      refs - the map of entity references to be populated during the process
    • getEntitiesReferences

      public void getEntitiesReferences(String entityName, String entityId, step.core.objectenricher.ObjectPredicate objectPredicate, EntityReferencesMap references, boolean recursive)
      get entities recursively by scanning the given entity (aka artefact), the entity is retrieved and deserialized from the db
      Parameters:
      entityName - name of the type of entity
      entityId - the id of the entity
      references - the map of references to be populated
    • updateReferences

      public void updateReferences(Object entity, Map<String,String> references, step.core.objectenricher.ObjectPredicate objectPredicate, Set<String> messageCollector)
    • addDependencyTreeVisitorHook

      public EntityManager addDependencyTreeVisitorHook(DependencyTreeVisitorHook hook)
      Parameters:
      hook - the hook instance to be registered
      Returns:
      this instance
    • getDependencyTreeVisitorHooks

      public List<DependencyTreeVisitorHook> getDependencyTreeVisitorHooks()
    • registerExportHook

      public void registerExportHook(BiConsumer<Object,ExportContext> exportBiConsumer)
    • runExportHooks

      public void runExportHooks(Object o, ExportContext exportContext)
    • registerImportHook

      public void registerImportHook(BiConsumer<Object,ImportContext> importBiConsumer)
    • runImportHooks

      public void runImportHooks(Object o, ImportContext importContext)