Package io.jmix.core.metamodel.model
Interface MetaClass
- All Superinterfaces:
MetadataObject
- All Known Implementing Classes:
KeyValueMetaClass,MetaClassImpl
Metadata object representing an entity.
-
Method Summary
Modifier and TypeMethodDescription@Nullable MetaPropertyfindProperty(String name) Get MetaProperty by its name.@Nullable MetaClassImmediate ancestor of the object, or null if there is no one.All ancestors of the metaclass, in order going up from the immediate ancestor.All descendants of the metaclass, recursively.<T> Class<T> getProperty(String name) Get MetaProperty by its name.@Nullable MetaPropertyPathgetPropertyPath(String propertyPath) Returns MetaPropertyPath object, representing path to the property from the current class Note that this method don't take into account extensions(e.g.@Nullable SessiongetStore()Methods inherited from interface io.jmix.core.metamodel.model.MetadataObject
getAnnotations, getName
-
Method Details
-
getSession
@Nullable Session getSession()- Returns:
- containing MetaModel instance. Null signifies a temporary metaclass, not associated with an entity class.
-
getJavaClass
- Returns:
- corresponding Java class
-
getAncestor
@Nullable MetaClass getAncestor()Immediate ancestor of the object, or null if there is no one. -
getAncestors
All ancestors of the metaclass, in order going up from the immediate ancestor. -
getDescendants
Collection<MetaClass> getDescendants()All descendants of the metaclass, recursively. Order is undefined. -
findProperty
Get MetaProperty by its name.- Returns:
- MetaProperty instance, or null if no such property found
-
getProperty
Get MetaProperty by its name.- Returns:
- MetaProperty instance. Throws exception if not found.
-
getPropertyPath
Returns MetaPropertyPath object, representing path to the property from the current class Note that this method don't take into account extensions(e.g. Dynamic Attributes add-on) and it returns null in case of not static attributes(attributes from extension). For getting all attributes (including attributes from extensions) useMetadataTools.resolveMetaPropertyPath(MetaClass, String)orMetadataTools.resolveMetaPropertyPathOrNull(MetaClass, String)methods.- Parameters:
propertyPath- dot-separated string- Returns:
- MetaPropertyPath instance, or null if the input parameter doesn't represent a valid path.
-
getOwnProperties
Collection<MetaProperty> getOwnProperties()- Returns:
- collection of meta properties directly owned by this metaclass.
-
getProperties
Collection<MetaProperty> getProperties()- Returns:
- collection of meta properties owned by this metaclass and all its ancestors.
-
getStore
Store getStore()- Returns:
- store of this entity
-