Top Description Fields Constructors Methods
org.hibernate.transform

public Class AliasToEntityMapResultTransformer

extends BasicTransformerAdapter
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.HashMap, .Map, java.io.Serializable

ResultTransformer implementation which builds a map for each "row", made up of each aliased value where the alias is the map key.

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 AliasToEntityMapResultTransformer

Constructor Summary

AccessConstructor and Description
private
AliasToEntityMapResultTransformer()

Disallow instantiation of AliasToEntityMapResultTransformer.

Method Summary

Modifier and TypeMethod and Description
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.

Tuples are the elements making up each "row" of the query result.
Inherited from org.hibernate.transform.BasicTransformerAdapter:
transformList

Field Detail

INSTANCEback to summary
public static final AliasToEntityMapResultTransformer INSTANCE

Constructor Detail

AliasToEntityMapResultTransformerback to summary
private AliasToEntityMapResultTransformer()

Disallow instantiation of AliasToEntityMapResultTransformer.

Method Detail

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.

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

Tuples are the elements making up each "row" of the query result. The contract here is to transform these elements into the final row.

Parameters
tuple:Object[]

The result elements

aliases:String[]

The result aliases ("parallel" array to tuple)

Returns:Object

The transformed row.