Package org.hibernate.mapping
Class Property
- java.lang.Object
-
- org.hibernate.mapping.Property
-
- All Implemented Interfaces:
java.io.Serializable
,MetaAttributable
- Direct Known Subclasses:
Backref
,IndexBackref
,SyntheticProperty
public class Property extends java.lang.Object implements java.io.Serializable, MetaAttributable
Represents a property as part of an entity or a component.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Property()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessorPropertyName(EntityMode mode)
java.lang.String
getCascade()
CascadeStyle
getCascadeStyle()
java.util.Iterator
getColumnIterator()
int
getColumnSpan()
Getter
getGetter(java.lang.Class clazz)
java.lang.String
getLazyGroup()
MetaAttribute
getMetaAttribute(java.lang.String attributeName)
java.util.Map
getMetaAttributes()
java.lang.String
getName()
PersistentClass
getPersistentClass()
java.lang.String
getPropertyAccessorName()
PropertyAccessStrategy
getPropertyAccessStrategy(java.lang.Class clazz)
Setter
getSetter(java.lang.Class clazz)
Type
getType()
Value
getValue()
ValueGeneration
getValueGenerationStrategy()
boolean
isBackRef()
boolean
isBasicPropertyAccessor()
boolean
isComposite()
boolean
isInsertable()
boolean
isLazy()
Is this property lazy in the "bytecode" sense? Lazy here means whether we should push *something* to the entity instance for this field in its "base fetch group".boolean
isLob()
boolean
isNaturalIdentifier()
boolean
isOptimisticLocked()
boolean
isOptional()
boolean
isPrimitive(java.lang.Class clazz)
boolean
isSelectable()
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.boolean
isUpdateable()
boolean
isValid(Mapping mapping)
protected ServiceRegistry
resolveServiceRegistry()
void
setCascade(java.lang.String cascade)
void
setInsertable(boolean insertable)
void
setLazy(boolean lazy)
void
setLazyGroup(java.lang.String lazyGroup)
void
setLob(boolean lob)
void
setMetaAttributes(java.util.Map metas)
void
setName(java.lang.String name)
void
setNaturalIdentifier(boolean naturalIdentifier)
void
setOptimisticLocked(boolean optimisticLocked)
void
setOptional(boolean optional)
void
setPersistentClass(PersistentClass persistentClass)
void
setPropertyAccessorName(java.lang.String string)
void
setSelectable(boolean selectable)
void
setUpdateable(boolean mutable)
void
setValue(Value value)
void
setValueGenerationStrategy(ValueGeneration valueGenerationStrategy)
java.lang.String
toString()
-
-
-
Method Detail
-
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()
-
getColumnIterator
public java.util.Iterator getColumnIterator()
-
getName
public java.lang.String getName()
-
isComposite
public boolean isComposite()
-
getValue
public Value getValue()
-
isPrimitive
public boolean isPrimitive(java.lang.Class clazz)
-
getCascadeStyle
public CascadeStyle getCascadeStyle() throws MappingException
- Throws:
MappingException
-
getCascade
public java.lang.String getCascade()
-
setCascade
public void setCascade(java.lang.String cascade)
-
setName
public void setName(java.lang.String name)
-
setValue
public void setValue(Value value)
-
isUpdateable
public boolean isUpdateable()
-
isInsertable
public boolean isInsertable()
-
getValueGenerationStrategy
public ValueGeneration getValueGenerationStrategy()
-
setValueGenerationStrategy
public void setValueGenerationStrategy(ValueGeneration valueGenerationStrategy)
-
setUpdateable
public void setUpdateable(boolean mutable)
-
setInsertable
public void setInsertable(boolean insertable)
-
getPropertyAccessorName
public java.lang.String getPropertyAccessorName()
-
setPropertyAccessorName
public void setPropertyAccessorName(java.lang.String string)
-
isBasicPropertyAccessor
public boolean isBasicPropertyAccessor()
-
getMetaAttributes
public java.util.Map getMetaAttributes()
- Specified by:
getMetaAttributes
in interfaceMetaAttributable
-
getMetaAttribute
public MetaAttribute getMetaAttribute(java.lang.String attributeName)
- Specified by:
getMetaAttribute
in interfaceMetaAttributable
-
setMetaAttributes
public void setMetaAttributes(java.util.Map metas)
- Specified by:
setMetaAttributes
in interfaceMetaAttributable
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Throws:
MappingException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setLazy
public void setLazy(boolean lazy)
-
isLazy
public boolean isLazy()
Is this property lazy in the "bytecode" sense? Lazy here means whether we should push *something* to the entity instance for this field in its "base fetch group". Mainly it affects whether we should list this property's columns in the SQL select for the owning entity when we load its "base fetch group". The "something" we push varies based on the nature (basic, etc) of the property.
-
getLazyGroup
public java.lang.String getLazyGroup()
-
setLazyGroup
public void setLazyGroup(java.lang.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
public java.lang.String getAccessorPropertyName(EntityMode mode)
-
getGetter
public Getter getGetter(java.lang.Class clazz) throws PropertyNotFoundException, MappingException
-
getSetter
public Setter getSetter(java.lang.Class clazz) throws PropertyNotFoundException, MappingException
-
getPropertyAccessStrategy
public PropertyAccessStrategy getPropertyAccessStrategy(java.lang.Class clazz) throws MappingException
- Throws:
MappingException
-
resolveServiceRegistry
protected ServiceRegistry resolveServiceRegistry()
-
isNaturalIdentifier
public boolean isNaturalIdentifier()
-
setNaturalIdentifier
public void setNaturalIdentifier(boolean naturalIdentifier)
-
isLob
public boolean isLob()
-
setLob
public void setLob(boolean lob)
-
-