Package org.hibernate.mapping
Class Property
java.lang.Object
org.hibernate.mapping.Property
- All Implemented Interfaces:
Serializable
,MetaAttributable
- Direct Known Subclasses:
Backref
,IndexBackref
,SyntheticProperty
A mapping model object representing a property or field of an entity
or embeddable class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallbackDefinitions
(List<CallbackDefinition> callbackDefinitions) copy()
Delegates toValue.getColumns()
.int
getMetaAttribute
(String attributeName) getName()
getPropertyAccessStrategy
(Class clazz) Delegates toValue.getSelectables()
.getType()
getValue()
boolean
boolean
boolean
boolean
boolean
boolean
isLazy()
Is this property lazy in the "bytecode" sense?boolean
isLob()
boolean
boolean
boolean
boolean
boolean
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
boolean
Deprecated.boolean
isValid
(MappingContext mappingContext) 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
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
void
setValueGeneratorCreator
(GeneratorCreator generator) toString()
-
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
- Throws:
MappingException
-
getColumnSpan
public int getColumnSpan() -
getSelectables
Delegates toValue.getSelectables()
. -
getColumns
Delegates toValue.getColumns()
.- Throws:
AssertionFailure
- if the mapping involves formulas
-
getName
-
isComposite
public boolean isComposite() -
getValue
-
resetUpdateable
public void resetUpdateable(boolean updateable) -
resetOptional
public void resetOptional(boolean optional) -
getCascadeStyle
- Throws:
MappingException
-
getCascade
-
setCascade
-
setName
-
setValue
-
isUpdateable
public boolean isUpdateable() -
isInsertable
public boolean isInsertable() -
getValueGeneratorCreator
-
setValueGeneratorCreator
-
setUpdateable
public void setUpdateable(boolean mutable) -
setInsertable
public void setInsertable(boolean insertable) -
getPropertyAccessorName
-
setPropertyAccessorName
-
getPropertyAccessStrategy
-
setPropertyAccessStrategy
-
isBasicPropertyAccessor
public boolean isBasicPropertyAccessor() -
getMetaAttributes
- Specified by:
getMetaAttributes
in interfaceMetaAttributable
-
getMetaAttribute
- Specified by:
getMetaAttribute
in interfaceMetaAttributable
-
setMetaAttributes
- Specified by:
setMetaAttributes
in interfaceMetaAttributable
-
isValid
Deprecated.- Throws:
MappingException
-
isValid
- Throws:
MappingException
-
toString
-
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
-
setLazyGroup
-
isOptimisticLocked
public boolean isOptimisticLocked() -
setOptimisticLocked
public void setOptimisticLocked(boolean optimisticLocked) -
isOptional
public boolean isOptional() -
setOptional
public void setOptional(boolean optional) -
getPersistentClass
-
setPersistentClass
-
isSelectable
public boolean isSelectable() -
setSelectable
public void setSelectable(boolean selectable) -
getGetter
- Throws:
MappingException
-
getSetter
- 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
-
getCallbackDefinitions
-
getReturnedClassName
-
setReturnedClassName
-
createGenerator
-
copy
-
isValid(MappingContext)