Class DynamicMetaProperty

All Implemented Interfaces:
CloneableMetaProperty, MetadataObject, MetaProperty

public class DynamicMetaProperty extends MetadataObjectImpl implements MetaProperty, CloneableMetaProperty
Metadata property implementation used for runtime dynamic attributes.
  • Field Details

    • metaClass

      protected final MetaClass metaClass
    • range

      protected final Range range
    • javaClass

      protected final Class<?> javaClass
    • mandatory

      protected final Boolean mandatory
    • readOnly

      protected final boolean readOnly
    • annotatedElement

      protected final AnnotatedElement annotatedElement
    • type

      protected final MetaProperty.Type type
    • inverse

      protected @Nullable MetaProperty inverse
    • store

      protected Store store
  • Constructor Details

    • DynamicMetaProperty

      public DynamicMetaProperty(MetaClass metaClass, String name, Class<?> javaClass, Range range, MetaProperty.Type type)
      Creates a writable dynamic metadata property without an inverse property.
    • DynamicMetaProperty

      public DynamicMetaProperty(MetaClass metaClass, String name, Class<?> javaClass, Range range, MetaProperty.Type type, @Nullable MetaProperty inverse)
      Creates a writable dynamic metadata property with an optional inverse property.
    • DynamicMetaProperty

      public DynamicMetaProperty(MetaClass metaClass, String name, Class<?> javaClass, Range range, MetaProperty.Type type, boolean readOnly)
      Creates a dynamic metadata property with explicit read-only state and without an inverse property.
    • DynamicMetaProperty

      public DynamicMetaProperty(MetaClass metaClass, String name, Class<?> javaClass, Range range, MetaProperty.Type type, boolean readOnly, @Nullable MetaProperty inverse)
      Creates a dynamic metadata property with explicit read-only state and optional inverse property.
    • DynamicMetaProperty

      public DynamicMetaProperty(MetaClass metaClass, String name, Class<?> javaClass, Range range, MetaProperty.Type type, boolean readOnly, boolean mandatory, @Nullable MetaProperty inverse)
      Creates a dynamic metadata property with explicit read-only, mandatory, and inverse state.
  • Method Details

    • makeClone

      public MetaProperty makeClone(MetaClass metaClass)
      Specified by:
      makeClone in interface CloneableMetaProperty
    • getSession

      public Session getSession()
      Specified by:
      getSession in interface MetaProperty
      Returns:
      containing MetaModel instance. Null signifies a temporary metaclass, not associated with an entity class.
    • getDomain

      public MetaClass getDomain()
      Specified by:
      getDomain in interface MetaProperty
      Returns:
      MetaClass, containing this MetaProperty.
      In case of ReplaceEntity returns extended meta class.
    • getRange

      public Range getRange()
      Specified by:
      getRange in interface MetaProperty
      Returns:
      Range of this property.
    • getType

      public MetaProperty.Type getType()
      Specified by:
      getType in interface MetaProperty
      Returns:
      property type (DATATYPE, ENUM, ASSOCIATION, COMPOSITION, EMBEDDED)
    • isMandatory

      public boolean isMandatory()
      Specified by:
      isMandatory in interface MetaProperty
      Returns:
      true if the corresponding entity attribute must contain a value
    • isReadOnly

      public boolean isReadOnly()
      Returns whether this dynamic metadata property is read-only.
      Specified by:
      isReadOnly in interface MetaProperty
      Returns:
      true for calculated dynamic properties
    • getInverse

      public @Nullable MetaProperty getInverse()
      Specified by:
      getInverse in interface MetaProperty
      Returns:
      a MetaProperty from the opposite side of relation, or null if this is not a reference property
    • getAnnotatedElement

      public AnnotatedElement getAnnotatedElement()
      Specified by:
      getAnnotatedElement in interface MetaProperty
      Returns:
      corresponding Java field or method as AnnotatedElement object
    • getJavaType

      public Class<?> getJavaType()
      Specified by:
      getJavaType in interface MetaProperty
      Returns:
      Java class of the corresponding field or method's return type
    • getDeclaringClass

      public @Nullable Class<?> getDeclaringClass()
      Specified by:
      getDeclaringClass in interface MetaProperty
      Returns:
      Java class which declares the corresponding field or method
    • getStore

      public Store getStore()
      Specified by:
      getStore in interface MetaProperty
    • setStore

      public void setStore(Store store)
    • setInverse

      public void setInverse(@Nullable MetaProperty inverse)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object