Package io.jmix.dynmodel.impl
Interface DynamicModelSchemaManager
- All Known Implementing Classes:
DbDynamicModelSchemaManager
@NullMarked
public interface DynamicModelSchemaManager
Interface for managing database schema for dynamic entities and attributes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidalterColumn(MetaClass metaClass, MetaProperty property) Alters the physical column type/length of an existing dynamic attribute to match the given property.voidclear()Removes all database objects created by this manager.voidcreateSchema(MetaClass metaClass, Collection<MetaProperty> properties) Creates or updates the database schema for the given entity and its dynamic properties.voidcreateUniqueConstraints(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Creates database unique constraints for the given entity.voidremoveAttribute(MetaClass metaClass, MetaProperty property) voidremoveEntity(MetaClass metaClass) voidremoveUniqueConstraints(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Removes database unique constraints for the given entity.voidvalidateUniqueConstraintsData(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Verifies that existing table data satisfies the given unique constraints, throwing if duplicates exist.
-
Method Details
-
createSchema
Creates or updates the database schema for the given entity and its dynamic properties.- Parameters:
metaClass- the entity meta-classproperties- the dynamic properties to create columns for
-
createUniqueConstraints
void createUniqueConstraints(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Creates database unique constraints for the given entity.- Parameters:
metaClass- owner metadata classuniqueConstraints- normalized unique constraints
-
validateUniqueConstraintsData
void validateUniqueConstraintsData(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Verifies that existing table data satisfies the given unique constraints, throwing if duplicates exist. Used to fail before a destructive constraint replacement so the old constraint is preserved on failure.- Parameters:
metaClass- owner metadata classuniqueConstraints- normalized unique constraints to validate against existing data
-
removeUniqueConstraints
void removeUniqueConstraints(MetaClass metaClass, Collection<DynamicUniqueConstraintDefinition> uniqueConstraints) Removes database unique constraints for the given entity.- Parameters:
metaClass- owner metadata classuniqueConstraints- normalized unique constraints
-
removeEntity
-
removeAttribute
-
alterColumn
Alters the physical column type/length of an existing dynamic attribute to match the given property.- Parameters:
metaClass- the owning entity meta-classproperty- the dynamic property whose column type changed
-
clear
void clear()Removes all database objects created by this manager.
-