Class EntityManager


  • public class EntityManager
    extends java.lang.Object
    • Method Detail

      • getEntityByName

        public Entity<?,​?> getEntityByName​(java.lang.String entityName)
      • resolveClass

        public java.lang.Class<?> resolveClass​(java.lang.String entityName)
      • getEntitiesReferences

        public void getEntitiesReferences​(java.lang.String entityType,
                                          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
      • getAllEntities

        public void getAllEntities​(java.lang.String entityName,
                                   java.lang.String id,
                                   ObjectPredicate objectPredicate,
                                   EntityReferencesMap references)
        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
        id - the id of the entity
        references - the map of references to be populated
      • getEntityByClass

        public Entity<?,​?> getEntityByClass​(java.lang.Class<?> c)
      • updateReferences

        public void updateReferences​(java.lang.Object object,
                                     java.util.Map<java.lang.String,​java.lang.String> references)
        Used when importing artefacts with new IDs to update all references accordingly if the map doesn't contain the old ID yet, a new id and corresponding map entry are created
      • registerExportHook

        public void registerExportHook​(java.util.function.BiConsumer<java.lang.Object,​ExportContext> exportBiConsumer)
      • runExportHooks

        public void runExportHooks​(java.lang.Object o,
                                   ExportContext exportContext)
      • registerImportHook

        public void registerImportHook​(java.util.function.BiConsumer<java.lang.Object,​ImportContext> importBiConsumer)
      • runImportHooks

        public void runImportHooks​(java.lang.Object o,
                                   ImportContext importContext)