Package io.jmix.dynmodel
Class DynamicModelTools
java.lang.Object
io.jmix.dynmodel.DynamicModelTools
Provides helper methods for working with dynamic model metadata and generated physical database names.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected DynamicModelDbSupportResolverprotected DynModelPropertiesstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected MetadataToolsstatic final Stringstatic final Stringprotected Stores -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllDynamicProperties(MetaClass metaClass) @Nullable DynamicValidationDefinition<?> getAttributeValidationDefinition(MetaProperty metaProperty) Returns validation metadata stored on a dynamic attribute property.@Nullable DynamicCalculatedAttributeDefinitiongetCalculatedDefinition(MetaProperty metaProperty) Returns the calculated-attribute definition stored on a metadata property.getCollectionInverseProperty(MetaClass ownerMetaClass, MetaProperty collectionProperty) getCollectionInversePropertyName(MetaClass ownerMetaClass, String propertyName) getCollectionOrderProperty(MetaClass ownerMetaClass, MetaProperty collectionProperty) getCollectionOrderPropertyName(MetaClass ownerMetaClass, String propertyName) getCollectionProperties(MetaClass metaClass) getColumnName(MetaProperty property) getDynamicEntityTableName(MetaClass metaClass) getDynamicEntityTableName(String entityName) getDynamicEntityTableName(String entityName, String storeName) getDynamicProperties(MetaClass metaClass) @Nullable DynamicValidationDefinition<?> getEntityValidationDefinition(MetaClass metaClass) Returns validation metadata stored on an entity metadata class.getGeneratedColumnName(String propertyName) getGeneratedColumnName(String propertyName, String storeName) getPhysicalStoreName(MetaClass metaClass) getSingleValueProperties(MetaClass metaClass) Returns non-collection dynamic properties stored in the database.getStaticEntityTableName(MetaClass metaClass) getStaticEntityTableName(String tableOrEntityName) getStaticEntityTableName(String tableOrEntityName, String storeName) getStoredDynamicEntityProperties(MetaClass metaClass) Returns dynamic entity properties that require physical table columns.getTableName(MetaClass metaClass) getUniqueConstraintDefinitions(MetaClass metaClass) Returns normalized unique-constraint metadata stored on an entity metadata class.getUniqueConstraintName(MetaClass metaClass, String logicalConstraintName) Returns the physical database unique-constraint name for a dynamic unique constraint.booleanisCalculatedProperty(MetaProperty metaProperty) Returns whether the metadata property is a calculated dynamic property.booleanisCollectionProperty(MetaProperty metaProperty) booleanisDynamicEntity(MetaClass metaClass) booleanisDynamicEntityPrimaryKey(MetaProperty property) booleanisDynamicProperty(MetaProperty metaProperty) booleanisInternalProperty(MetaProperty metaProperty) voidmarkAsCollectionProperty(MetaProperty property) voidmarkAsInternalProperty(MetaProperty property) voidmarkAsOrderProperty(MetaProperty property) normalizeGeneratedIdentifier(MetaClass metaClass, String value) normalizeGeneratedIdentifier(String value, String storeName) protected StringnormalizeName(String value) normalizeStoreName(@Nullable String storeName) voidsetPhysicalStoreName(MetaClass metaClass, String storeName) voidvalidatePhysicalStoreName(String storeName)
-
Field Details
-
ID_COLUMN_NAME
- See Also:
-
COLLECTION_ANN_NAME
- See Also:
-
INTERNAL_ANN_NAME
- See Also:
-
ORDER_ANN_NAME
- See Also:
-
STORE_ANN_NAME
- See Also:
-
CALCULATED_ANN_NAME
- See Also:
-
ATTRIBUTE_VALIDATION_ANN_NAME
- See Also:
-
ENTITY_VALIDATION_ANN_NAME
- See Also:
-
ENTITY_UNIQUE_CONSTRAINTS_ANN_NAME
- See Also:
-
metadataTools
-
dynModelProperties
-
dbSupportResolver
-
stores
-
-
Constructor Details
-
DynamicModelTools
public DynamicModelTools()
-
-
Method Details
-
getDataStoreNames
-
isDynamicProperty
-
isInternalProperty
-
isCollectionProperty
-
isCalculatedProperty
Returns whether the metadata property is a calculated dynamic property.- Parameters:
metaProperty- metadata property- Returns:
trueif the property has calculated-attribute metadata
-
getCalculatedDefinition
public @Nullable DynamicCalculatedAttributeDefinition getCalculatedDefinition(MetaProperty metaProperty) Returns the calculated-attribute definition stored on a metadata property.- Parameters:
metaProperty- metadata property- Returns:
- calculated definition, or
null
-
getAttributeValidationDefinition
public @Nullable DynamicValidationDefinition<?> getAttributeValidationDefinition(MetaProperty metaProperty) Returns validation metadata stored on a dynamic attribute property.- Parameters:
metaProperty- metadata property- Returns:
- validation definition, or
null
-
getEntityValidationDefinition
Returns validation metadata stored on an entity metadata class.- Parameters:
metaClass- metadata class- Returns:
- validation definition, or
null
-
getUniqueConstraintDefinitions
Returns normalized unique-constraint metadata stored on an entity metadata class.- Parameters:
metaClass- metadata class- Returns:
- normalized unique constraints
-
getAllDynamicProperties
-
getDynamicProperties
-
getSingleValueProperties
Returns non-collection dynamic properties stored in the database.Calculated properties are excluded because they are evaluated in memory.
- Parameters:
metaClass- owner metadata class- Returns:
- stored single-value dynamic properties
-
getCollectionProperties
-
getStoredDynamicEntityProperties
Returns dynamic entity properties that require physical table columns.Calculated properties are excluded because they are non-persistent.
- Parameters:
metaClass- dynamic entity metadata class- Returns:
- stored dynamic entity properties
-
getTableName
-
getStaticEntityTableName
-
getStaticEntityTableName
-
getStaticEntityTableName
-
getDynamicEntityTableName
-
getDynamicEntityTableName
-
getDynamicEntityTableName
-
isDynamicEntity
-
getColumnName
-
isDynamicEntityPrimaryKey
-
getGeneratedColumnName
-
getGeneratedColumnName
-
getUniqueConstraintName
Returns the physical database unique-constraint name for a dynamic unique constraint.- Parameters:
metaClass- owner metadata classlogicalConstraintName- logical unique-constraint name- Returns:
- physical unique-constraint name
-
normalizeGeneratedIdentifier
-
normalizeGeneratedIdentifier
-
normalizeGeneratedIdentifier
-
normalizeStoreName
-
validatePhysicalStoreName
-
getPhysicalStoreName
-
setPhysicalStoreName
-
getCollectionInversePropertyName
-
getCollectionOrderPropertyName
-
getCollectionInverseProperty
public MetaProperty getCollectionInverseProperty(MetaClass ownerMetaClass, MetaProperty collectionProperty) -
getCollectionOrderProperty
public MetaProperty getCollectionOrderProperty(MetaClass ownerMetaClass, MetaProperty collectionProperty) -
markAsCollectionProperty
-
markAsInternalProperty
-
markAsOrderProperty
-
normalizeName
-