@Entity
@Convert( attributeName="homeAddress.city", ... )
class Person {
...
@Embedded
@Convert( attributeName="city", ... )
public Address homeAddress;
}
</pre>
public class ComponentPropertyHolder extends AbstractPropertyHolder
PropertyHolder for composites (Embeddable/Embedded). <p/> To facilitate code comments, I’ll often refer to this example: <pre> @Embeddable @Convert( attributeName="city", … ) class Address { … @Convert(…) public String city; }
@Entity
@Convert( attributeName="homeAddress.city", ... )
class Person {
...
@Embedded
@Convert( attributeName="city", ... )
public Address homeAddress;
}
</pre>
As you can see, lots of ways to specify the conversion for embeddable attributes :(
parent| Constructor and Description |
|---|
ComponentPropertyHolder(Component component,
String path,
PropertyData inferredData,
PropertyHolder parent,
MetadataBuildingContext context) |
| Modifier and Type | Method and Description |
|---|---|
Join |
addJoin(JoinTable joinTableAnn,
boolean noDelayInPkColumnCreation) |
void |
addProperty(Property prop,
Ejb3Column[] columns,
org.hibernate.annotations.common.reflection.XClass declaringClass) |
void |
addProperty(Property prop,
org.hibernate.annotations.common.reflection.XClass declaringClass) |
String |
getClassName() |
String |
getEntityName() |
String |
getEntityOwnerClassName() |
KeyValue |
getIdentifier() |
Column[] |
getOverriddenColumn(String propertyName)
Get column overriding, property first, then parent, then holder
replace the placeholder 'collection&&element' with nothing
|
JoinColumn[] |
getOverriddenJoinColumn(String propertyName)
Get column overriding, property first, then parent, then holder
replace the placeholder 'collection&&element' with nothing
|
PersistentClass |
getPersistentClass() |
Table |
getTable() |
boolean |
isComponent() |
boolean |
isEntity() |
boolean |
isOrWithinEmbeddedId()
Return true if this component is or is embedded in a @EmbeddedId
|
boolean |
isWithinElementCollection()
Return true if this component is withing an @ElementCollection.
|
protected AttributeConversionInfo |
locateAttributeConversionInfo(String path) |
protected AttributeConversionInfo |
locateAttributeConversionInfo(org.hibernate.annotations.common.reflection.XProperty property) |
protected String |
normalizeCompositePath(String attributeName) |
protected String |
normalizeCompositePathForLogging(String attributeName) |
void |
setParentProperty(String parentProperty) |
void |
startingProperty(org.hibernate.annotations.common.reflection.XProperty property)
Called during binding to allow the PropertyHolder to inspect its discovered properties.
|
String |
toString() |
buildExceptionFromInstantiationError, getContext, getJoinTable, getOverriddenForeignKey, getOverriddenJoinTable, getPath, isInIdClass, makeAttributeConverterDescriptor, resolveAttributeConverterDescriptor, setCurrentProperty, setInIdClasspublic ComponentPropertyHolder(Component component, String path, PropertyData inferredData, PropertyHolder parent, MetadataBuildingContext context)
protected String normalizeCompositePath(String attributeName)
normalizeCompositePath in class AbstractPropertyHolderprotected String normalizeCompositePathForLogging(String attributeName)
normalizeCompositePathForLogging in class AbstractPropertyHolderpublic void startingProperty(org.hibernate.annotations.common.reflection.XProperty property)
PropertyHolderCalled during binding to allow the PropertyHolder to inspect its discovered properties. Mainly this is used in collecting attribute conversion declarations (via @Convert/@Converts).
property - The propertyprotected AttributeConversionInfo locateAttributeConversionInfo(org.hibernate.annotations.common.reflection.XProperty property)
locateAttributeConversionInfo in class AbstractPropertyHolderprotected AttributeConversionInfo locateAttributeConversionInfo(String path)
locateAttributeConversionInfo in class AbstractPropertyHolderpublic String getEntityName()
public void addProperty(Property prop, Ejb3Column[] columns, org.hibernate.annotations.common.reflection.XClass declaringClass)
public String getClassName()
public String getEntityOwnerClassName()
public Table getTable()
public void addProperty(Property prop, org.hibernate.annotations.common.reflection.XClass declaringClass)
public KeyValue getIdentifier()
public boolean isOrWithinEmbeddedId()
PropertyHolderReturn true if this component is or is embedded in a @EmbeddedId
public boolean isWithinElementCollection()
PropertyHolderReturn true if this component is withing an @ElementCollection.
public PersistentClass getPersistentClass()
public boolean isComponent()
public boolean isEntity()
public void setParentProperty(String parentProperty)
setParentProperty in interface PropertyHoldersetParentProperty in class AbstractPropertyHolderpublic Column[] getOverriddenColumn(String propertyName)
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.
getOverriddenColumn in interface PropertyHoldergetOverriddenColumn in class AbstractPropertyHolderpublic JoinColumn[] getOverriddenJoinColumn(String propertyName)
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.
getOverriddenJoinColumn in interface PropertyHoldergetOverriddenJoinColumn in class AbstractPropertyHolderCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.