Class DataModelRegistry

java.lang.Object
io.jmix.datatools.datamodel.DataModelRegistry

@Component("datatl_DataModelProvider") public class DataModelRegistry extends Object
Provides information about entity data models organized by data stores.
  • Field Details

  • Constructor Details

    • DataModelRegistry

      public DataModelRegistry()
  • Method Details

    • reset

      public void reset()
      Make the registry to reload data models on the next request.
    • checkInitialized

      protected void checkInitialized()
    • init

      protected void init()
    • constructDataModel

      protected void constructDataModel()
    • createEntityDescription

      protected DataModel createEntityDescription(MetaClass entity, boolean isEmbeddable)
    • addDatatypeAttribute

      protected void addDatatypeAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList)
    • addEmbeddedAttribute

      protected void addEmbeddedAttribute(MetaClass entity, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList)
    • addManyToOneAttribute

      protected void addManyToOneAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList, String dataStoreName, Map<RelationType,List<Relation>> relationsMap)
    • addOneToManyAttribute

      protected void addOneToManyAttribute(MetaClass entity, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType,List<Relation>> relationsMap, List<AttributeModel> attributeModelsList)
    • addOneToOneAttribute

      protected void addOneToOneAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType,List<Relation>> relationsMap, List<AttributeModel> attributeModelsList)
    • addManyToManyAttribute

      protected void addManyToManyAttribute(MetaClass entity, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType,List<Relation>> relationsMap, List<AttributeModel> attributeModelsList)
    • addElementCollectionAttribute

      protected void addElementCollectionAttribute(MetaClass entity, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList)
    • constructEntityModel

      protected EntityModel constructEntityModel(MetaClass entity, boolean isSystem)
    • putRelation

      protected void putRelation(Map<RelationType,List<Relation>> relations, RelationType relationType, Relation relation)
    • constructAttribute

      protected AttributeModel constructAttribute(String fieldName, String fieldType)
    • constructAttribute

      protected AttributeModel constructAttribute(String fieldName, String fieldType, boolean isMandatory)
    • constructAttribute

      protected AttributeModel constructAttribute(String columnName, String fieldName, String fieldType, MetaClass entity, boolean isMandatory)
    • constructAttribute

      protected AttributeModel constructAttribute(String columnName, String fieldName, String fieldType, String dbType, boolean isMandatory)
    • getDatabaseColumnType

      protected String getDatabaseColumnType(@Nullable String schemaName, @Nullable String catalogName, String tableName, String columnName)
    • getDatabaseColumnType

      protected String getDatabaseColumnType(MetaClass entity, String columnName)
    • getCatalogName

      @Nullable protected String getCatalogName(jakarta.persistence.Table annotation)
    • getSchemaName

      @Nullable protected String getSchemaName(jakarta.persistence.Table annotation)
    • putDataModel

      protected void putDataModel(DataModel dataModel)
    • getDataStoreNames

      public Set<String> getDataStoreNames()
    • 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
    • isAnnotationPresent

      protected boolean isAnnotationPresent(MetaProperty field, Class<? extends Annotation> annotationClass)
    • getAnnotation

      protected <T extends Annotation> T getAnnotation(MetaProperty field, Class<T> annotationClass)
    • getElementTypeFromCollection

      protected String getElementTypeFromCollection(MetaProperty metaProperty)