Class DataModelProvider

java.lang.Object
io.jmix.datatoolsflowui.datamodel.DataModelProvider

public class DataModelProvider extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getDataModels

      public Map<String,Map<String,DataModel>> getDataModels()
      Retrieves an unmodifiable view of the internal data model storage. The returned map represents an organizational structure where the first-level keys are data store identifiers and the values are nested maps. The nested maps use entity names as keys and their corresponding DataModel objects as values.
      Returns:
      a map containing data store identifiers as keys, where each value is another map that maps entity names to their respective DataModel instances. The returned map is unmodifiable.
    • getDataModels

      public Map<String,DataModel> getDataModels(String dataStore)
      Retrieves the data models associated with a specific data store.
      Parameters:
      dataStore - the name of the data store whose data models are to be retrieved; must not be null
      Returns:
      a map where the keys are entity names and the values are the corresponding DataModel instances
    • getDataModel

      @Nullable public DataModel getDataModel(String dataStore, String entityName)
      Retrieves the DataModel associated with the given data store and entity name.
      Parameters:
      dataStore - the name of the data store from which the data model is to be fetched
      entityName - the name of the entity whose data model is to be fetched
      Returns:
      the DataModel corresponding to the specified data store and entity name, or null if no such data model exists
    • hasRelations

      public boolean hasRelations(String dataStore, String entityName)
      Determines whether the given entity in the specified data store has any relationships defined.
      Parameters:
      dataStore - the name of the data store to which the entity belongs; must not be null
      entityName - the name of the entity to check for relationships; must not be null
      Returns:
      true if the entity has at least one relationship defined in the data model, false otherwise
    • getEntityRelations

      public Map<RelationType,List<Relation>> getEntityRelations(String dataStore, String entityName)
      Retrieves the relationships defined for a specific entity in the data model of a given data store.
      Parameters:
      dataStore - the name of the data store containing the desired entity; must not be null
      entityName - the name of the entity for which the relationships are to be retrieved; must not be null
      Returns:
      a map where the keys specify the type of relationships (e.g., MANY_TO_ONE, ONE_TO_MANY) and the values are lists of Relation objects detailing the relationships; if the entity or data store has no relationships, an empty map is returned
    • getEntityAttributes

      public List<AttributeModel> getEntityAttributes(String dataStore, String entityName)
      Retrieves a list of attributes for a specific entity within a given data store.
      Parameters:
      dataStore - the name of the data store containing the entity; must not be null
      entityName - the name of the entity whose attributes are to be retrieved; must not be null
      Returns:
      a list of AttributeModel representing the attributes defined for the specified entity; an empty list is returned if the entity has no attributes or if the data store or entity does not exist
    • getEntityModel

      @Nullable public EntityModel getEntityModel(String dataStore, String entityName)
      Retrieves the EntityModel associated with the specified data store and entity name.
      Parameters:
      dataStore - the name of the data store where the entity resides; must not be null
      entityName - the name of the entity whose model is to be retrieved; must not be null
      Returns:
      the EntityModel corresponding to the specified data store and entity name, or null if no such entity model exists