Package io.jmix.datatools.datamodel
Interface DataModelContributor
- All Known Implementing Classes:
DynamicModelDataModelContributor
@NullMarked
public interface DataModelContributor
Describes entities and attributes that JPA metadata cannot describe, so that they take part in the
data model. Implementations are consulted in bean order. For
describeEntity(MetaClass) and
describeAttribute(MetaClass, MetaProperty) the first one that handles an object wins; the
entities of getAdditionalEntities() are collected from all implementations and
de-duplicated by entity name.
An implementation is expected not to throw: a call that fails is logged and skipped, and whatever that implementation would have contributed is missing from the data model.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable AttributeDescriptordescribeAttribute(MetaClass entity, MetaProperty property) Describes a property that is not a JPA attribute.default @Nullable EntityDescriptordescribeEntity(MetaClass metaClass) Describes the physical placement of an entity.default Collection<MetaClass> Returns entities to add to the data model in addition to JPA entities.
-
Method Details
-
getAdditionalEntities
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.- Returns:
- contributed entity meta-classes, empty if none
-
describeEntity
Describes the physical placement of an entity.- Parameters:
metaClass- entity meta-class- Returns:
- descriptor, or
nullif this contributor does not handle the entity
-
describeAttribute
Describes a property that is not a JPA attribute.- Parameters:
entity- owner entity meta-classproperty- property to describe- Returns:
- descriptor, or
nullif this contributor does not handle the property
-