Top Description Fields Constructors Methods
org.hibernate.loader.plan.build.internal.spaces

public Class CompositePropertyMapping

extends Object
implements PropertyMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.persister.entity.PropertyMapping
Imports
org.hibernate.QueryException, org.hibernate.internal.util.StringHelper, org.hibernate.persister.entity.PropertyMapping, org.hibernate.type.CompositeType, .Type

A PropertyMapping for handling composites! Woohoo!

TODO : Consider moving this into the attribute/association walking SPI (org.hibernate.persister.walking) and having the notion of PropertyMapping built and exposed there

There is duplication here too wrt org.hibernate.hql.internal.ast.tree.ComponentJoin.ComponentPropertyMapping. like above, consider moving to a singly-defined CompositePropertyMapping in the attribute/association walking SPI

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final CompositeType
private final PropertyMapping
private final String

Constructor Summary

AccessConstructor and Description
public
CompositePropertyMapping(CompositeType
The composite being described by this PropertyMapping
compositeType
,
PropertyMapping
The PropertyMapping of our parent (composites have to have a parent/owner)
parentPropertyMapping
,
String
The name of this composite within the parentPropertyMapping
parentPropertyName
)

Builds a CompositePropertyMapping

Method Summary

Modifier and TypeMethod and Description
protected void
checkIncomingPropertyName(String
The incoming propertyName argument to validate
propertyName
)

Used to check the validity of the propertyName argument passed into toType(String), toColumns(String, String) and toColumns(String).

public CompositeType
getType()

Implements org.hibernate.persister.entity.PropertyMapping.getType.

Get the type of the thing containing the properties
protected String

Returns:

The relative path
resolveParentPropertyPath
(String
The incoming property name to "path append".
propertyName
)

Builds the relative path.

public String[]
toColumns(String alias, String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Obtain aliased column/formula fragments for the specified property path.
public String[]
toColumns(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Given a property path, return the corresponding column name(s).
protected String

Returns:

The relative path.
toParentPropertyPath
(String
The incoming propertyName.
propertyName
)

Used to build a property path relative to parentPropertyMapping.

public Type
toType(String propertyName)

Implements org.hibernate.persister.entity.PropertyMapping.toType.

Given a component path expression, get the type of the property
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

compositeTypeback to summary
private final CompositeType compositeType
parentPropertyMappingback to summary
private final PropertyMapping parentPropertyMapping
parentPropertyNameback to summary
private final String parentPropertyName

Constructor Detail

CompositePropertyMappingback to summary
public CompositePropertyMapping(CompositeType compositeType, PropertyMapping parentPropertyMapping, String parentPropertyName)

Builds a CompositePropertyMapping

Parameters
compositeType:CompositeType

The composite being described by this PropertyMapping

parentPropertyMapping:PropertyMapping

The PropertyMapping of our parent (composites have to have a parent/owner)

parentPropertyName:String

The name of this composite within the parentPropertyMapping

Method Detail

checkIncomingPropertyNameback to summary
protected void checkIncomingPropertyName(String propertyName)

Used to check the validity of the propertyName argument passed into toType(String), toColumns(String, String) and toColumns(String).

Parameters
propertyName:String

The incoming propertyName argument to validate

getTypeback to summary
public CompositeType getType()

Implements org.hibernate.persister.entity.PropertyMapping.getType.

Doc from org.hibernate.persister.entity.PropertyMapping.getType.

Get the type of the thing containing the properties

Annotations
@Override
resolveParentPropertyPathback to summary
protected String resolveParentPropertyPath(String propertyName)

Builds the relative path. Used to delegate toType(String), toColumns(String, String) and toColumns(String) calls out to parentPropertyMapping.

Called from toParentPropertyPath.

Override this to adjust how the relative property path is built for this mapping.

Parameters
propertyName:String

The incoming property name to "path append".

Returns:String

The relative path

toColumnsback to summary
public String[] toColumns(String alias, String propertyName) throws QueryException

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Doc from org.hibernate.persister.entity.PropertyMapping.toColumns.

Obtain aliased column/formula fragments for the specified property path.

Annotations
@Override
toColumnsback to summary
public String[] toColumns(String propertyName) throws QueryException, UnsupportedOperationException

Implements org.hibernate.persister.entity.PropertyMapping.toColumns.

Doc from org.hibernate.persister.entity.PropertyMapping.toColumns.

Given a property path, return the corresponding column name(s).

Annotations
@Override
toParentPropertyPathback to summary
protected String toParentPropertyPath(String propertyName)

Used to build a property path relative to parentPropertyMapping. First, the incoming propertyName argument is validated (using checkIncomingPropertyName). Then the relative path is built (using resolveParentPropertyPath).

Parameters
propertyName:String

The incoming propertyName.

Returns:String

The relative path.

toTypeback to summary
public Type toType(String propertyName) throws QueryException

Implements org.hibernate.persister.entity.PropertyMapping.toType.

Doc from org.hibernate.persister.entity.PropertyMapping.toType.

Given a component path expression, get the type of the property

Annotations
@Override