Top Description Fields Constructors Methods
org.hibernate.boot.model.internal

public Class ComponentPropertyHolder

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

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 final Map<String, AttributeConversionInfo>
private final Component
private final String
private final boolean
private final boolean
Inherited from org.hibernate.boot.model.internal.AbstractPropertyHolder:
parent

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.hibernate.boot.model.internal.PropertyHolder.addJoin.

public Join
addJoin(JoinTable joinTable, Table table, boolean noDelayInPkColumnCreation)

Implements org.hibernate.boot.model.internal.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.boot.model.internal.AbstractPropertyHolder.getOverriddenColumn.

Implements org.hibernate.boot.model.internal.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.boot.model.internal.AbstractPropertyHolder.getOverriddenJoinColumn.

Implements org.hibernate.boot.model.internal.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
public boolean
public boolean
public boolean
isOrWithinEmbeddedId()

Implements org.hibernate.boot.model.internal.PropertyHolder.isOrWithinEmbeddedId.

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

Implements org.hibernate.boot.model.internal.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.boot.model.internal.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.boot.model.internal.AbstractPropertyHolder:
buildExceptionFromInstantiationErrorgetContextgetJoinTablegetOverriddenColumnTransformergetOverriddenForeignKeygetOverriddenJoinTablegetPathisInIdClassmakeAttributeConverterDescriptorresolveAttributeConverterDescriptorsetCurrentPropertysetInIdClass

Field Detail

attributeConversionInfoMapback to summary
private final Map<String, AttributeConversionInfo> attributeConversionInfoMap
componentback to summary
private final Component component
embeddedAttributeNameback to summary
private final String embeddedAttributeName
isOrWithinEmbeddedIdback to summary
private final boolean isOrWithinEmbeddedId
isWithinElementCollectionback to summary
private final 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 joinTable, boolean noDelayInPkColumnCreation)

Implements org.hibernate.boot.model.internal.PropertyHolder.addJoin.

Annotations
@Override
addJoinback to summary
public Join addJoin(JoinTable joinTable, Table table, boolean noDelayInPkColumnCreation)

Implements org.hibernate.boot.model.internal.PropertyHolder.addJoin.

Annotations
@Override
addPropertyback to summary
public void addProperty(Property property, AnnotatedColumns columns, XClass declaringClass)

Implements org.hibernate.boot.model.internal.PropertyHolder.addProperty.

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

Implements org.hibernate.boot.model.internal.PropertyHolder.addProperty.

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

Implements org.hibernate.boot.model.internal.PropertyHolder.getClassName.

Annotations
@Override
getEntityNameback to summary
public String getEntityName()

Implements org.hibernate.boot.model.internal.PropertyHolder.getEntityName.

Annotations
@Override
getEntityOwnerClassNameback to summary
public String getEntityOwnerClassName()

Implements org.hibernate.boot.model.internal.PropertyHolder.getEntityOwnerClassName.

Annotations
@Override
getIdentifierback to summary
public KeyValue getIdentifier()

Implements org.hibernate.boot.model.internal.PropertyHolder.getIdentifier.

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

Overrides org.hibernate.boot.model.internal.AbstractPropertyHolder.getOverriddenColumn.

Implements org.hibernate.boot.model.internal.PropertyHolder.getOverriddenColumn.

Doc from org.hibernate.boot.model.internal.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.boot.model.internal.AbstractPropertyHolder.getOverriddenJoinColumn.

Implements org.hibernate.boot.model.internal.PropertyHolder.getOverriddenJoinColumn.

Doc from org.hibernate.boot.model.internal.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.boot.model.internal.PropertyHolder.getPersistentClass.

Annotations
@Override
getTableback to summary
public Table getTable()

Implements org.hibernate.boot.model.internal.PropertyHolder.getTable.

Annotations
@Override
isComponentback to summary
public boolean isComponent()

Implements org.hibernate.boot.model.internal.PropertyHolder.isComponent.

Annotations
@Override
isEntityback to summary
public boolean isEntity()

Implements org.hibernate.boot.model.internal.PropertyHolder.isEntity.

Annotations
@Override
isOrWithinEmbeddedIdback to summary
public boolean isOrWithinEmbeddedId()

Implements org.hibernate.boot.model.internal.PropertyHolder.isOrWithinEmbeddedId.

Doc from org.hibernate.boot.model.internal.PropertyHolder.isOrWithinEmbeddedId.

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

Annotations
@Override
isWithinElementCollectionback to summary
public boolean isWithinElementCollection()

Implements org.hibernate.boot.model.internal.PropertyHolder.isWithinElementCollection.

Doc from org.hibernate.boot.model.internal.PropertyHolder.isWithinElementCollection.

Return true if this component is within an @ElementCollection.

Annotations
@Override
locateAttributeConversionInfoback to summary
protected AttributeConversionInfo locateAttributeConversionInfo(XProperty property)

Implements abstract org.hibernate.boot.model.internal.AbstractPropertyHolder.locateAttributeConversionInfo.

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

Implements abstract org.hibernate.boot.model.internal.AbstractPropertyHolder.locateAttributeConversionInfo.

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

Implements abstract org.hibernate.boot.model.internal.AbstractPropertyHolder.normalizeCompositePath.

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

Implements abstract org.hibernate.boot.model.internal.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.boot.model.internal.AbstractPropertyHolder.setParentProperty.

Implements org.hibernate.boot.model.internal.PropertyHolder.setParentProperty.

Annotations
@Override
startingPropertyback to summary
public void startingProperty(XProperty property)

Implements org.hibernate.boot.model.internal.PropertyHolder.startingProperty.

Doc from org.hibernate.boot.model.internal.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