Interface DynamicModelSchemaManager

All Known Implementing Classes:
DbDynamicModelSchemaManager

@NullMarked public interface DynamicModelSchemaManager
Interface for managing database schema for dynamic entities and attributes.
  • Method Details

    • createSchema

      void createSchema(MetaClass metaClass, Collection<MetaProperty> properties)
      Creates or updates the database schema for the given entity and its dynamic properties.
      Parameters:
      metaClass - the entity meta-class
      properties - 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 class
      uniqueConstraints - 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 class
      uniqueConstraints - 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 class
      uniqueConstraints - normalized unique constraints
    • removeEntity

      void removeEntity(MetaClass metaClass)
    • removeAttribute

      void removeAttribute(MetaClass metaClass, MetaProperty property)
    • alterColumn

      void alterColumn(MetaClass metaClass, MetaProperty property)
      Alters the physical column type/length of an existing dynamic attribute to match the given property.
      Parameters:
      metaClass - the owning entity meta-class
      property - the dynamic property whose column type changed
    • clear

      void clear()
      Removes all database objects created by this manager.