Class DynamicModelDataModelContributor

java.lang.Object
io.jmix.dynmodel.datatools.DynamicModelDataModelContributor
All Implemented Interfaces:
DataModelContributor

public class DynamicModelDataModelContributor extends Object implements DataModelContributor
Describes dynamic entities and dynamic attributes for the Data Tools data model.

This class references types of the optional jmix-datatools add-on, so it must not be a component: it is created only by DynamicModelDatatoolsAutoConfiguration, which is conditional on datatools being on the classpath.

  • Field Details

  • Constructor Details

    • DynamicModelDataModelContributor

      public DynamicModelDataModelContributor()
  • Method Details

    • getAdditionalEntities

      public Collection<MetaClass> getAdditionalEntities()
      Description copied from interface: DataModelContributor
      Returns entities to add to the data model in addition to JPA entities. The result is added to what the other implementations return, so an entity already in the model is not added twice.
      Specified by:
      getAdditionalEntities in interface DataModelContributor
      Returns:
      contributed entity meta-classes, empty if none
    • describeEntity

      public @Nullable EntityDescriptor describeEntity(MetaClass metaClass)
      Description copied from interface: DataModelContributor
      Describes the physical placement of an entity.
      Specified by:
      describeEntity in interface DataModelContributor
      Parameters:
      metaClass - entity meta-class
      Returns:
      descriptor, or null if this contributor does not handle the entity
    • describeAttribute

      public @Nullable AttributeDescriptor describeAttribute(MetaClass entity, MetaProperty property)
      Describes a dynamic attribute. The helper properties generated for a collection are included: they are real columns of the child's table.
      Specified by:
      describeAttribute in interface DataModelContributor
      Parameters:
      entity - owner entity meta-class
      property - property to describe
      Returns:
      descriptor, or null if this contributor does not handle the property
    • describePrimaryKey

      protected AttributeDescriptor describePrimaryKey(MetaClass entity, MetaProperty property)
      Describes the identifier of a dynamic entity. It is declared on DynamicEntity instead of being generated, so it is not a dynamic property, but it is still a column of the entity's table.
    • isGeneratedEntity

      protected boolean isGeneratedEntity(MetaClass metaClass)
      Returns whether the meta-class is an entity generated from a dynamic model definition. DynamicEntity itself is registered too, but it is only the base class and has no table.
    • javaTypeOf

      protected String javaTypeOf(MetaProperty property)
    • relationOf

      protected @Nullable AttributeDescriptor.RelationDescriptor relationOf(MetaProperty property)