Package io.jmix.datatools.datamodel
Class DataModelRegistry
java.lang.Object
io.jmix.datatools.datamodel.DataModelRegistry
Provides information about entity data models organized by data stores.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataSourceprotected DbmsTypeprotected DiagramEngineprotected booleanprotected final ReadWriteLockprotected Metadataprotected MetadataTools -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDatatypeAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList) protected voidaddElementCollectionAttribute(MetaClass entity, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList) protected voidaddEmbeddedAttribute(MetaClass entity, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList) protected voidaddManyToManyAttribute(MetaClass entity, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType, List<Relation>> relationsMap, List<AttributeModel> attributeModelsList) protected voidaddManyToOneAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, List<AttributeModel> attributeModelsList, String dataStoreName, Map<RelationType, List<Relation>> relationsMap) protected voidaddOneToManyAttribute(MetaClass entity, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType, List<Relation>> relationsMap, List<AttributeModel> attributeModelsList) protected voidaddOneToOneAttribute(MetaClass entity, boolean isEmbeddable, MetaProperty field, String fieldName, String dataStoreName, Map<RelationType, List<Relation>> relationsMap, List<AttributeModel> attributeModelsList) protected voidprotected AttributeModelconstructAttribute(String fieldName, String fieldType) protected AttributeModelconstructAttribute(String fieldName, String fieldType, boolean isMandatory) protected AttributeModelconstructAttribute(String columnName, String fieldName, String fieldType, MetaClass entity, boolean isMandatory) protected AttributeModelconstructAttribute(String columnName, String fieldName, String fieldType, String dbType, boolean isMandatory) protected voidprotected EntityModelconstructEntityModel(MetaClass entity, boolean isSystem) protected DataModelcreateEntityDescription(MetaClass entity, boolean isEmbeddable) protected <T extends Annotation>
TgetAnnotation(MetaProperty field, Class<T> annotationClass) protected StringgetCatalogName(jakarta.persistence.Table annotation) protected StringgetDatabaseColumnType(MetaClass entity, String columnName) protected StringgetDatabaseColumnType(String schemaName, String catalogName, String tableName, String columnName) Retrieves an unmodifiable view of the internal data model storage.getDataModels(String dataStore) Retrieves the data models associated with a specific data store.protected StringgetElementTypeFromCollection(MetaProperty metaProperty) protected StringgetSchemaName(jakarta.persistence.Table annotation) protected voidinit()protected booleanisAnnotationPresent(MetaProperty field, Class<? extends Annotation> annotationClass) protected voidputDataModel(DataModel dataModel) protected voidputRelation(Map<RelationType, List<Relation>> relations, RelationType relationType, Relation relation) voidreset()Make the registry to reload data models on the next request.
-
Field Details
-
dbmsType
-
metadata
-
dataSource
-
diagramEngine
-
metadataTools
-
dataModels
-
lock
-
initialized
protected volatile boolean initialized
-
-
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
-
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
-
putRelation
protected void putRelation(Map<RelationType, List<Relation>> relations, RelationType relationType, Relation relation) -
constructAttribute
-
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
-
getDatabaseColumnType
-
getCatalogName
-
getSchemaName
-
putDataModel
-
getDataStoreNames
-
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 correspondingDataModelobjects as values.- Returns:
- a map containing data store identifiers as keys, where each value is another map that
maps entity names to their respective
DataModelinstances. The returned map is unmodifiable.
-
getDataModels
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
DataModelinstances
-
isAnnotationPresent
protected boolean isAnnotationPresent(MetaProperty field, Class<? extends Annotation> annotationClass) -
getAnnotation
-
getElementTypeFromCollection
-