Top Description Methods
org.hibernate.transform

public Interface ResultTransformer

extends Serializable
Known Direct Subinterfaces
org.hibernate.transform.TupleSubsetResultTransformer
Known Direct Implementers
org.hibernate.transform.AliasToBeanConstructorResultTransformer, org.hibernate.transform.BasicTransformerAdapter, org.hibernate.transform.CacheableResultTransformer
Imports
java.io.Serializable, java.util.List

Implementors define a strategy for transforming query results into the actual application-visible query result list.
Author
Gavin King
See Also
org.hibernate.Criteria#setResultTransformer(ResultTransformer), org.hibernate.Query#setResultTransformer(ResultTransformer)

Method Summary

Modifier and TypeMethod and Description
public List<E>

Returns:

The transformed result.
transformList
(List<E>
The result.
collection
)

Here we have an opportunity to perform transformation on the query result as a whole.

public Object

Returns:

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

Tuples are the elements making up each "row" of the query result.

Method Detail

transformListback to summary
public List<E> transformList(List<E> collection)

Here we have an opportunity to perform transformation on the query result as a whole. This might be useful to convert from one collection type to another or to remove duplicates from the result, etc.

Parameters
collection:List<E>

The result.

Returns:List<E>

The transformed result.

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

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.