Top Description Fields Constructors Methods
org.hibernate.transform

public final Class RootEntityResultTransformer

extends BasicTransformerAdapter
implements TupleSubsetResultTransformer
Class Inheritance
All Implemented Interfaces
org.hibernate.transform.TupleSubsetResultTransformer, org.hibernate.transform.ResultTransformer, java.io.Serializable
Imports
org.hibernate.internal.util.collections.ArrayHelper

ResultTransformer implementation which limits the result tuple to only the "root entity".

Since this transformer is stateless, all instances would be considered equal. So for optimization purposes we limit it to a single, singleton instance.

Authors
Gavin King, Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final RootEntityResultTransformer

Constructor Summary

AccessConstructor and Description
private
RootEntityResultTransformer()

Disallow instantiation of RootEntityResultTransformer.

Method Summary

Modifier and TypeMethod and Description
public boolean[]
includeInTransform(String[]
- the aliases that correspond to the tuple
aliases
,
int
- the number of elements in the tuple
tupleLength
)

Implements org.hibernate.transform.TupleSubsetResultTransformer.includeInTransform.

Returns an array with the i-th element indicating whether the i-th element of the tuple is included in the transformed value.
public boolean
isTransformedValueATupleElement(String[]
- the aliases that correspond to the tuple
aliases
,
int
- the number of elements in the tuple
tupleLength
)

Implements org.hibernate.transform.TupleSubsetResultTransformer.isTransformedValueATupleElement.

When a tuple is transformed, is the result a single element of the tuple?
private Object

Returns:

The singleton instance : INSTANCE
readResolve
()

Serialization hook for ensuring singleton uniqueing.

public Object
transformTuple(Object[]
The result elements
tuple
,
String[]
The result aliases ("parallel" array to tuple)
aliases
)

Overrides org.hibernate.transform.BasicTransformerAdapter.transformTuple.

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Return just the root entity from the row tuple.
Inherited from org.hibernate.transform.BasicTransformerAdapter:
transformList

Field Detail

INSTANCEback to summary
public static final RootEntityResultTransformer INSTANCE

Constructor Detail

RootEntityResultTransformerback to summary
private RootEntityResultTransformer()

Disallow instantiation of RootEntityResultTransformer.

Method Detail

includeInTransformback to summary
public boolean[] includeInTransform(String[] aliases, int tupleLength)

Implements org.hibernate.transform.TupleSubsetResultTransformer.includeInTransform.

Doc from org.hibernate.transform.TupleSubsetResultTransformer.includeInTransform.

Returns an array with the i-th element indicating whether the i-th element of the tuple is included in the transformed value.

Parameters
aliases:String[]

- the aliases that correspond to the tuple

tupleLength:int

- the number of elements in the tuple

Returns:boolean[]

array with the i-th element indicating whether the i-th element of the tuple is included in the transformed value.

Annotations
@Override
isTransformedValueATupleElementback to summary
public boolean isTransformedValueATupleElement(String[] aliases, int tupleLength)

Implements org.hibernate.transform.TupleSubsetResultTransformer.isTransformedValueATupleElement.

Doc from org.hibernate.transform.TupleSubsetResultTransformer.isTransformedValueATupleElement.

When a tuple is transformed, is the result a single element of the tuple?

Parameters
aliases:String[]

- the aliases that correspond to the tuple

tupleLength:int

- the number of elements in the tuple

Returns:boolean

true, if the transformed value is a single element of the tuple; false, otherwise.

Annotations
@Override
readResolveback to summary
private Object readResolve()

Serialization hook for ensuring singleton uniqueing.

Returns:Object

The singleton instance : INSTANCE

transformTupleback to summary
public Object transformTuple(Object[] tuple, String[] aliases)

Overrides org.hibernate.transform.BasicTransformerAdapter.transformTuple.

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Return just the root entity from the row tuple.

Parameters
tuple:Object[]

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The result elements

aliases:String[]

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The result aliases ("parallel" array to tuple)

Returns:Object

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The transformed row.

Annotations
@Override