Top Description Methods
org.hibernate.query

public Interface TupleTransformer<T>

Known Direct Subinterfaces
org.hibernate.query.TypedTupleTransformer, org.hibernate.transform.ResultTransformer
Known Direct Implementers
org.hibernate.jpa.spi.NativeQueryConstructorTransformer, org.hibernate.jpa.spi.NativeQueryListTransformer, org.hibernate.jpa.spi.NativeQueryMapTransformer
Annotations
@Incubating
@FunctionalInterface
Imports
org.hibernate.Incubating, org.hibernate.sql.results.internal.RowTransformerTupleTransformerAdapter, java.util.List

Defines some transformation applied to each result of a Query before the results are packaged as a List and returned to the caller. Each result is received as a tuple (that is, as an Object[]), and may be transformed to some other type.

Implementation Note

Every TupleTransformer is automatically wrapped in an instance of RowTransformerTupleTransformerAdapter, adapting it to the org.hibernate.sql.results.spi.RowTransformer contract, which is always used to actually process the results internally.

Authors
Steve Ebersole, Gavin King
See Also
Query#setTupleTransformer, Query#list, Query#getResultList, ResultListTransformer, org.hibernate.sql.results.spi.RowTransformer

Method Summary

Modifier and TypeMethod and Description
public T

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

transformTupleback to summary
public T 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 shape.

Parameters
tuple:Object[]

The result elements

aliases:String[]

The result aliases ("parallel" array to tuple)

Returns:T

The transformed row.