Package org.hibernate.cfg
Class ComponentPropertyHolder
- java.lang.Object
-
- org.hibernate.cfg.AbstractPropertyHolder
-
- org.hibernate.cfg.ComponentPropertyHolder
-
- All Implemented Interfaces:
PropertyHolder
public class ComponentPropertyHolder extends AbstractPropertyHolder
PropertyHolder for composites (Embeddable/Embedded). To facilitate code comments, I'll often refer to this example:@Embeddable @Convert( attributeName="city", ... ) class Address { ... @Convert(...) public String city; } @Entity @Convert( attributeName="homeAddress.city", ... ) class Person { ... @Embedded @Convert( attributeName="city", ... ) public Address homeAddress; }As you can see, lots of ways to specify the conversion for embeddable attributes :(
-
-
Field Summary
-
Fields inherited from class org.hibernate.cfg.AbstractPropertyHolder
parent
-
-
Constructor Summary
Constructors Constructor Description ComponentPropertyHolder(Component component, java.lang.String path, PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoinaddJoin(JoinTable joinTableAnn, boolean noDelayInPkColumnCreation)voidaddProperty(Property prop, org.hibernate.annotations.common.reflection.XClass declaringClass)voidaddProperty(Property prop, Ejb3Column[] columns, org.hibernate.annotations.common.reflection.XClass declaringClass)java.lang.StringgetClassName()java.lang.StringgetEntityName()java.lang.StringgetEntityOwnerClassName()KeyValuegetIdentifier()Column[]getOverriddenColumn(java.lang.String propertyName)Get column overriding, property first, then parent, then holder replace the placeholder 'collection&&element' with nothing These rules are here to support both JPA 2 and legacy overriding rules.JoinColumn[]getOverriddenJoinColumn(java.lang.String propertyName)Get column overriding, property first, then parent, then holder replace the placeholder 'collection&&element' with nothing These rules are here to support both JPA 2 and legacy overriding rules.PersistentClassgetPersistentClass()TablegetTable()booleanisComponent()booleanisEntity()booleanisOrWithinEmbeddedId()Return true if this component is or is embedded in a @EmbeddedIdbooleanisWithinElementCollection()Return true if this component is within an @ElementCollection.protected AttributeConversionInfolocateAttributeConversionInfo(java.lang.String path)protected AttributeConversionInfolocateAttributeConversionInfo(org.hibernate.annotations.common.reflection.XProperty property)protected java.lang.StringnormalizeCompositePath(java.lang.String attributeName)protected java.lang.StringnormalizeCompositePathForLogging(java.lang.String attributeName)voidsetParentProperty(java.lang.String parentProperty)voidstartingProperty(org.hibernate.annotations.common.reflection.XProperty property)Called during binding to allow the PropertyHolder to inspect its discovered properties.java.lang.StringtoString()-
Methods inherited from class org.hibernate.cfg.AbstractPropertyHolder
buildExceptionFromInstantiationError, getContext, getJoinTable, getOverriddenForeignKey, getOverriddenJoinTable, getPath, isInIdClass, makeAttributeConverterDescriptor, resolveAttributeConverterDescriptor, setCurrentProperty, setInIdClass
-
-
-
-
Constructor Detail
-
ComponentPropertyHolder
public ComponentPropertyHolder(Component component, java.lang.String path, PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context)
-
-
Method Detail
-
normalizeCompositePath
protected java.lang.String normalizeCompositePath(java.lang.String attributeName)
- Specified by:
normalizeCompositePathin classAbstractPropertyHolder
-
normalizeCompositePathForLogging
protected java.lang.String normalizeCompositePathForLogging(java.lang.String attributeName)
- Specified by:
normalizeCompositePathForLoggingin classAbstractPropertyHolder
-
startingProperty
public void startingProperty(org.hibernate.annotations.common.reflection.XProperty property)
Description copied from interface:PropertyHolderCalled during binding to allow the PropertyHolder to inspect its discovered properties. Mainly this is used in collecting attribute conversion declarations (via @Convert/@Converts).- Parameters:
property- The property
-
locateAttributeConversionInfo
protected AttributeConversionInfo locateAttributeConversionInfo(org.hibernate.annotations.common.reflection.XProperty property)
- Specified by:
locateAttributeConversionInfoin classAbstractPropertyHolder
-
locateAttributeConversionInfo
protected AttributeConversionInfo locateAttributeConversionInfo(java.lang.String path)
- Specified by:
locateAttributeConversionInfoin classAbstractPropertyHolder
-
getEntityName
public java.lang.String getEntityName()
-
addProperty
public void addProperty(Property prop, Ejb3Column[] columns, org.hibernate.annotations.common.reflection.XClass declaringClass)
-
getClassName
public java.lang.String getClassName()
-
getEntityOwnerClassName
public java.lang.String getEntityOwnerClassName()
-
getTable
public Table getTable()
-
addProperty
public void addProperty(Property prop, org.hibernate.annotations.common.reflection.XClass declaringClass)
-
getIdentifier
public KeyValue getIdentifier()
-
isOrWithinEmbeddedId
public boolean isOrWithinEmbeddedId()
Description copied from interface:PropertyHolderReturn true if this component is or is embedded in a @EmbeddedId
-
isWithinElementCollection
public boolean isWithinElementCollection()
Description copied from interface:PropertyHolderReturn true if this component is within an @ElementCollection.
-
getPersistentClass
public PersistentClass getPersistentClass()
-
isComponent
public boolean isComponent()
-
isEntity
public boolean isEntity()
-
setParentProperty
public void setParentProperty(java.lang.String parentProperty)
- Specified by:
setParentPropertyin interfacePropertyHolder- Overrides:
setParentPropertyin classAbstractPropertyHolder
-
getOverriddenColumn
public Column[] getOverriddenColumn(java.lang.String propertyName)
Description copied from class:AbstractPropertyHolderGet column overriding, property first, then parent, then holder replace the placeholder 'collection&&element' with nothing These rules are here to support both JPA 2 and legacy overriding rules.- Specified by:
getOverriddenColumnin interfacePropertyHolder- Overrides:
getOverriddenColumnin classAbstractPropertyHolder
-
getOverriddenJoinColumn
public JoinColumn[] getOverriddenJoinColumn(java.lang.String propertyName)
Description copied from class:AbstractPropertyHolderGet column overriding, property first, then parent, then holder replace the placeholder 'collection&&element' with nothing These rules are here to support both JPA 2 and legacy overriding rules.- Specified by:
getOverriddenJoinColumnin interfacePropertyHolder- Overrides:
getOverriddenJoinColumnin classAbstractPropertyHolder
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-