Top Description Fields Constructors Methods
org.hibernate.cfg

public Class ComponentPropertyHolder

extends AbstractPropertyHolder
Class Inheritance
Imports
java.util.HashMap, .Map, javax.persistence.Column, .Convert, .Converts, .EmbeddedId, .Id, .JoinColumn, .JoinTable, org.hibernate.AnnotationException, org.hibernate.annotations.common.reflection.XClass, .XProperty, org.hibernate.boot.spi.MetadataBuildingContext, org.hibernate.internal.util.StringHelper, org.hibernate.loader.PropertyPath, org.hibernate.mapping.Component, .Join, .KeyValue, .PersistentClass, .Property, .Table

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 :(
Authors
Steve Ebersole, Emmanuel Bernard

Field Summary

Modifier and TypeField and Description
private Map<String, AttributeConversionInfo>
private Component
private String
private boolean
private boolean
Inherited from org.hibernate.cfg.AbstractPropertyHolder:
parent

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Join
addJoin(JoinTable joinTableAnn, boolean noDelayInPkColumnCreation)

Implements org.hibernate.cfg.PropertyHolder.addJoin.

public void
public void
private String
extractUserPropertyName(String redundantString, String propertyName)

public String
public String
public String
public KeyValue
public Column[]
getOverriddenColumn(String propertyName)

Overrides org.hibernate.cfg.AbstractPropertyHolder.getOverriddenColumn.

Implements org.hibernate.cfg.PropertyHolder.getOverriddenColumn.

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.
public JoinColumn[]
getOverriddenJoinColumn(String propertyName)

Overrides org.hibernate.cfg.AbstractPropertyHolder.getOverriddenJoinColumn.

Implements org.hibernate.cfg.PropertyHolder.getOverriddenJoinColumn.

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.
public PersistentClass
public Table
getTable()

Implements org.hibernate.cfg.PropertyHolder.getTable.

Deprecated as a consequence of Table being deprecated.
public boolean
public boolean
public boolean
isOrWithinEmbeddedId()

Implements org.hibernate.cfg.PropertyHolder.isOrWithinEmbeddedId.

Return true if this component is or is embedded in a @EmbeddedId
public boolean
isWithinElementCollection()

Implements org.hibernate.cfg.PropertyHolder.isWithinElementCollection.

Return true if this component is within an @ElementCollection.
protected AttributeConversionInfo
protected AttributeConversionInfo
protected String
protected String
private Map<String, AttributeConversionInfo>
processAttributeConversions(XProperty
The property that is the composite being described by this ComponentPropertyHolder
embeddedXProperty
)

This is called from our constructor and handles (in order):

  1. @Convert annotation at the Embeddable class level
  2. @Converts annotation at the Embeddable class level
  3. @Convert annotation at the Embedded attribute level
  4. @Converts annotation at the Embedded attribute level
private void
private Map<String, AttributeConversionInfo>
public void
public void
startingProperty(XProperty
The property
property
)

Implements org.hibernate.cfg.PropertyHolder.startingProperty.

Called during binding to allow the PropertyHolder to inspect its discovered properties.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.hibernate.cfg.AbstractPropertyHolder:
buildExceptionFromInstantiationErrorgetContextgetJoinTablegetOverriddenForeignKeygetOverriddenJoinTablegetPathisInIdClassmakeAttributeConverterDescriptorresolveAttributeConverterDescriptorsetCurrentPropertysetInIdClass

Field Detail

attributeConversionInfoMapback to summary
private Map<String, AttributeConversionInfo> attributeConversionInfoMap
componentback to summary
private Component component
embeddedAttributeNameback to summary
private String embeddedAttributeName
isOrWithinEmbeddedIdback to summary
private boolean isOrWithinEmbeddedId
isWithinElementCollectionback to summary
private boolean isWithinElementCollection

Constructor Detail

ComponentPropertyHolderback to summary
public ComponentPropertyHolder(Component component, String path, PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context)

Method Detail

addJoinback to summary
public Join addJoin(JoinTable joinTableAnn, boolean noDelayInPkColumnCreation)

Implements org.hibernate.cfg.PropertyHolder.addJoin.

addPropertyback to summary
public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass)

Implements org.hibernate.cfg.PropertyHolder.addProperty.

addPropertyback to summary
public void addProperty(Property prop, XClass declaringClass)

Implements org.hibernate.cfg.PropertyHolder.addProperty.

extractUserPropertyNameback to summary
private String extractUserPropertyName(String redundantString, String propertyName)
getClassNameback to summary
public String getClassName()

Implements org.hibernate.cfg.PropertyHolder.getClassName.

getEntityNameback to summary
public String getEntityName()

Implements org.hibernate.cfg.PropertyHolder.getEntityName.

getEntityOwnerClassNameback to summary
public String getEntityOwnerClassName()

Implements org.hibernate.cfg.PropertyHolder.getEntityOwnerClassName.

getIdentifierback to summary
public KeyValue getIdentifier()

Implements org.hibernate.cfg.PropertyHolder.getIdentifier.

getOverriddenColumnback to summary
public Column[] getOverriddenColumn(String propertyName)

Overrides org.hibernate.cfg.AbstractPropertyHolder.getOverriddenColumn.

Implements org.hibernate.cfg.PropertyHolder.getOverriddenColumn.

Doc from org.hibernate.cfg.AbstractPropertyHolder.getOverriddenColumn.

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.

Annotations
@Override
getOverriddenJoinColumnback to summary
public JoinColumn[] getOverriddenJoinColumn(String propertyName)

Overrides org.hibernate.cfg.AbstractPropertyHolder.getOverriddenJoinColumn.

Implements org.hibernate.cfg.PropertyHolder.getOverriddenJoinColumn.

Doc from org.hibernate.cfg.AbstractPropertyHolder.getOverriddenJoinColumn.

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.

Annotations
@Override
getPersistentClassback to summary
public PersistentClass getPersistentClass()

Implements org.hibernate.cfg.PropertyHolder.getPersistentClass.

getTableback to summary
public Table getTable()

Implements org.hibernate.cfg.PropertyHolder.getTable.

Deprecated

as a consequence of Table being deprecated. See corresponding docs for further information.

isComponentback to summary
public boolean isComponent()

Implements org.hibernate.cfg.PropertyHolder.isComponent.

isEntityback to summary
public boolean isEntity()

Implements org.hibernate.cfg.PropertyHolder.isEntity.

isOrWithinEmbeddedIdback to summary
public boolean isOrWithinEmbeddedId()

Implements org.hibernate.cfg.PropertyHolder.isOrWithinEmbeddedId.

Doc from org.hibernate.cfg.PropertyHolder.isOrWithinEmbeddedId.

Return true if this component is or is embedded in a @EmbeddedId

isWithinElementCollectionback to summary
public boolean isWithinElementCollection()

Implements org.hibernate.cfg.PropertyHolder.isWithinElementCollection.

Doc from org.hibernate.cfg.PropertyHolder.isWithinElementCollection.

Return true if this component is within an @ElementCollection.

locateAttributeConversionInfoback to summary
protected AttributeConversionInfo locateAttributeConversionInfo(XProperty property)

Implements abstract org.hibernate.cfg.AbstractPropertyHolder.locateAttributeConversionInfo.

Annotations
@Override
locateAttributeConversionInfoback to summary
protected AttributeConversionInfo locateAttributeConversionInfo(String path)

Implements abstract org.hibernate.cfg.AbstractPropertyHolder.locateAttributeConversionInfo.

Annotations
@Override
normalizeCompositePathback to summary
protected String normalizeCompositePath(String attributeName)

Implements abstract org.hibernate.cfg.AbstractPropertyHolder.normalizeCompositePath.

Annotations
@Override
normalizeCompositePathForLoggingback to summary
protected String normalizeCompositePathForLogging(String attributeName)

Implements abstract org.hibernate.cfg.AbstractPropertyHolder.normalizeCompositePathForLogging.

Annotations
@Override
processAttributeConversionsback to summary
private Map<String, AttributeConversionInfo> processAttributeConversions(XProperty embeddedXProperty)

This is called from our constructor and handles (in order):

  1. @Convert annotation at the Embeddable class level
  2. @Converts annotation at the Embeddable class level
  3. @Convert annotation at the Embedded attribute level
  4. @Converts annotation at the Embedded attribute level

The order is important to ensure proper precedence.

@Convert/@Converts annotations at the Embeddable attribute level are handled in the calls to startingProperty. Duplicates are simply ignored there.

Parameters
embeddedXProperty:XProperty

The property that is the composite being described by this ComponentPropertyHolder

processAttributeConversionsback to summary
private void processAttributeConversions(XClass embeddableXClass, Map<String, AttributeConversionInfo> infoMap)
processAttributeConversionsback to summary
private Map<String, AttributeConversionInfo> processAttributeConversions(XClass embeddableXClass)
setParentPropertyback to summary
public void setParentProperty(String parentProperty)

Overrides org.hibernate.cfg.AbstractPropertyHolder.setParentProperty.

Implements org.hibernate.cfg.PropertyHolder.setParentProperty.

startingPropertyback to summary
public void startingProperty(XProperty property)

Implements org.hibernate.cfg.PropertyHolder.startingProperty.

Doc from org.hibernate.cfg.PropertyHolder.startingProperty.

Called 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:XProperty

The property

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override