Class Property

java.lang.Object
org.hibernate.mapping.Property
All Implemented Interfaces:
Serializable, MetaAttributable
Direct Known Subclasses:
Backref, IndexBackref, SyntheticProperty

public class Property extends Object implements Serializable, MetaAttributable
A mapping model object representing a property or field of an entity or embeddable class.
See Also:
  • Constructor Details

    • Property

      public Property()
  • Method Details

    • isBackRef

      public boolean isBackRef()
    • isSynthetic

      public boolean isSynthetic()
      Does this property represent a synthetic property? A synthetic property is one we create during metamodel binding to represent a collection of columns but which does not represent a property physically available on the entity.
      Returns:
      True if synthetic; false otherwise.
    • getType

      public Type getType() throws MappingException
      Throws:
      MappingException
    • getColumnSpan

      public int getColumnSpan()
    • getSelectables

      public List<Selectable> getSelectables()
    • getColumns

      public List<Column> getColumns()
      Delegates to Value.getColumns().
      Throws:
      AssertionFailure - if the mapping involves formulas
    • getName

      public String getName()
    • isComposite

      public boolean isComposite()
    • getValue

      public Value getValue()
    • resetUpdateable

      public void resetUpdateable(boolean updateable)
    • resetOptional

      public void resetOptional(boolean optional)
    • isPrimitive

      @Deprecated(since="6", forRemoval=true) public boolean isPrimitive(Class<?> clazz)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method is no longer used
    • getCascadeStyle

      public CascadeStyle getCascadeStyle() throws MappingException
      Throws:
      MappingException
    • getCascade

      public String getCascade()
    • setCascade

      public void setCascade(String cascade)
    • setName

      public void setName(String name)
    • setValue

      public void setValue(Value value)
    • isUpdateable

      public boolean isUpdateable()
    • isInsertable

      public boolean isInsertable()
    • getValueGeneratorCreator

      @Internal public GeneratorCreator getValueGeneratorCreator()
    • setValueGeneratorCreator

      @Internal public void setValueGeneratorCreator(GeneratorCreator generator)
    • setUpdateable

      public void setUpdateable(boolean mutable)
    • setInsertable

      public void setInsertable(boolean insertable)
    • getPropertyAccessorName

      public String getPropertyAccessorName()
    • setPropertyAccessorName

      public void setPropertyAccessorName(String string)
    • getPropertyAccessStrategy

      public PropertyAccessStrategy getPropertyAccessStrategy()
    • setPropertyAccessStrategy

      public void setPropertyAccessStrategy(PropertyAccessStrategy propertyAccessStrategy)
    • isBasicPropertyAccessor

      public boolean isBasicPropertyAccessor()
    • getMetaAttributes

      public Map<String,MetaAttribute> getMetaAttributes()
      Specified by:
      getMetaAttributes in interface MetaAttributable
    • getMetaAttribute

      public MetaAttribute getMetaAttribute(String attributeName)
      Specified by:
      getMetaAttribute in interface MetaAttributable
    • setMetaAttributes

      public void setMetaAttributes(Map<String,MetaAttribute> metas)
      Specified by:
      setMetaAttributes in interface MetaAttributable
    • isValid

      public boolean isValid(Mapping mapping) throws MappingException
      Throws:
      MappingException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setLazy

      public void setLazy(boolean lazy)
    • isLazy

      public boolean isLazy()
      Is this property lazy in the "bytecode" sense?

      Lazy here means whether we initialize this field of the entity instance in its "base fetch group". It affects whether we list this property's columns in the SQL select for the owning entity when we load its "base fetch group". The actual value that is set varies based on the nature (basic, etc) of the property.

      API Note:
      This method reports whether the property is considered part of the base fetch group based solely on the information in the mapping but EnhancementHelper.includeInBaseFetchGroup(org.hibernate.mapping.Property, boolean, org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper.InheritanceChecker, boolean) is also accounts for other details.
    • getLazyGroup

      public String getLazyGroup()
    • setLazyGroup

      public void setLazyGroup(String lazyGroup)
    • isOptimisticLocked

      public boolean isOptimisticLocked()
    • setOptimisticLocked

      public void setOptimisticLocked(boolean optimisticLocked)
    • isOptional

      public boolean isOptional()
    • setOptional

      public void setOptional(boolean optional)
    • getPersistentClass

      public PersistentClass getPersistentClass()
    • setPersistentClass

      public void setPersistentClass(PersistentClass persistentClass)
    • isSelectable

      public boolean isSelectable()
    • setSelectable

      public void setSelectable(boolean selectable)
    • getAccessorPropertyName

      @Deprecated(since="6", forRemoval=true) public String getAccessorPropertyName(RepresentationMode mode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method is no longer used
    • getGetter

      @Internal public Getter getGetter(Class clazz) throws MappingException
      Throws:
      MappingException
    • getSetter

      @Internal public Setter getSetter(Class clazz) throws MappingException
      Throws:
      MappingException
    • getPropertyAccessStrategy

      @Internal public PropertyAccessStrategy getPropertyAccessStrategy(Class clazz) throws MappingException
      Throws:
      MappingException
    • isNaturalIdentifier

      public boolean isNaturalIdentifier()
    • setNaturalIdentifier

      public void setNaturalIdentifier(boolean naturalIdentifier)
    • isGeneric

      public boolean isGeneric()
    • setGeneric

      public void setGeneric(boolean generic)
    • isLob

      public boolean isLob()
    • setLob

      public void setLob(boolean lob)
    • addCallbackDefinitions

      public void addCallbackDefinitions(List<CallbackDefinition> callbackDefinitions)
    • getCallbackDefinitions

      public List<CallbackDefinition> getCallbackDefinitions()
    • getReturnedClassName

      public String getReturnedClassName()
    • setReturnedClassName

      public void setReturnedClassName(String returnedClassName)
    • createGenerator

      public Generator createGenerator(RuntimeModelCreationContext context)
    • copy

      public Property copy()