Package org.hibernate.mapping
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Property()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCallbackDefinitions(List<CallbackDefinition> callbackDefinitions)
Property
copy()
Generator
createGenerator(RuntimeModelCreationContext context)
String
getAccessorPropertyName(RepresentationMode mode)
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer usedList<CallbackDefinition>
getCallbackDefinitions()
String
getCascade()
CascadeStyle
getCascadeStyle()
List<Column>
getColumns()
Delegates toValue.getColumns()
.int
getColumnSpan()
Getter
getGetter(Class clazz)
String
getLazyGroup()
MetaAttribute
getMetaAttribute(String attributeName)
Map<String,MetaAttribute>
getMetaAttributes()
String
getName()
PersistentClass
getPersistentClass()
String
getPropertyAccessorName()
PropertyAccessStrategy
getPropertyAccessStrategy()
PropertyAccessStrategy
getPropertyAccessStrategy(Class clazz)
String
getReturnedClassName()
List<Selectable>
getSelectables()
Delegates toValue.getSelectables()
.Setter
getSetter(Class clazz)
Type
getType()
Value
getValue()
GeneratorCreator
getValueGeneratorCreator()
boolean
isBackRef()
boolean
isBasicPropertyAccessor()
boolean
isComposite()
boolean
isGeneric()
boolean
isInsertable()
boolean
isLazy()
Is this property lazy in the "bytecode" sense?boolean
isLob()
boolean
isNaturalIdentifier()
boolean
isOptimisticLocked()
boolean
isOptional()
boolean
isPrimitive(Class<?> clazz)
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer usedboolean
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)
void
resetOptional(boolean optional)
void
resetUpdateable(boolean updateable)
void
setCascade(String cascade)
void
setGeneric(boolean generic)
void
setInsertable(boolean insertable)
void
setLazy(boolean lazy)
void
setLazyGroup(String lazyGroup)
void
setLob(boolean lob)
void
setMetaAttributes(Map<String,MetaAttribute> metas)
void
setName(String name)
void
setNaturalIdentifier(boolean naturalIdentifier)
void
setOptimisticLocked(boolean optimisticLocked)
void
setOptional(boolean optional)
void
setPersistentClass(PersistentClass persistentClass)
void
setPropertyAccessorName(String string)
void
setPropertyAccessStrategy(PropertyAccessStrategy propertyAccessStrategy)
void
setReturnedClassName(String returnedClassName)
void
setSelectable(boolean selectable)
void
setUpdateable(boolean mutable)
void
setValue(Value value)
void
setValueGeneratorCreator(GeneratorCreator generator)
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()
-
getSelectables
public List<Selectable> getSelectables()
Delegates toValue.getSelectables()
.
-
getColumns
public List<Column> getColumns()
Delegates toValue.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 interfaceMetaAttributable
-
getMetaAttribute
public MetaAttribute getMetaAttribute(String attributeName)
- Specified by:
getMetaAttribute
in interfaceMetaAttributable
-
setMetaAttributes
public void setMetaAttributes(Map<String,MetaAttribute> metas)
- Specified by:
setMetaAttributes
in interfaceMetaAttributable
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Throws:
MappingException
-
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()
-
-