Top Description Inners Fields Constructors Methods
org.hibernate.jpa.spi

public Class TupleBuilderTransformer

extends BasicTransformerAdapter
Class Inheritance
Imports
java.util.Collections, .List, .Map, javax.persistence.Tuple, .TupleElement, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.transform.BasicTransformerAdapter, org.hibernate.type.Type

ResultTransformer adapter for handling Tuple results from HQL/JPQL queries
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public class

Field Summary

Modifier and TypeField and Description
private List<TupleElement<?>>
private Map<String, TupleBuilderTransformer.HqlTupleElementImpl<X>>

Constructor Summary

AccessConstructor and Description
public
TupleBuilderTransformer(Query<R> hqlQuery)

Deprecated as a consequence of Query being deprecated.

Method Summary

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

tupleElementsback to summary
private List<TupleElement<?>> tupleElements
tupleElementsByAliasback to summary
private Map<String, TupleBuilderTransformer.HqlTupleElementImpl<X>> tupleElementsByAlias

Constructor Detail

TupleBuilderTransformerback to summary
public TupleBuilderTransformer(Query<R> hqlQuery)

Deprecated

as a consequence of Query being deprecated. See corresponding docs for further information.

Method Detail

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.

Annotations
@Override
org.hibernate.jpa.spi back to summary

public Class TupleBuilderTransformer.HqlTupleElementImpl<X>

extends Object
implements TupleElement<X>
Class Inheritance
  • java.lang.Object
  • org.hibernate.jpa.spi.TupleBuilderTransformer.HqlTupleElementImpl
All Implemented Interfaces
javax.persistence.TupleElement

Field Summary

Modifier and TypeField and Description
private final String
private final Type
private final int

Constructor Summary

AccessConstructor and Description
public
HqlTupleElementImpl(int position, String alias, Type hibernateType)

Method Summary

Modifier and TypeMethod and Description
public String
getAlias()

Implements javax.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.
public Type
public Class<T>
getJavaType()

Implements javax.persistence.TupleElement.getJavaType.

Return the Java type of the tuple element.
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasback to summary
private final String alias
hibernateTypeback to summary
private final Type hibernateType
positionback to summary
private final int position

Constructor Detail

HqlTupleElementImplback to summary
public HqlTupleElementImpl(int position, String alias, Type hibernateType)

Method Detail

getAliasback to summary
public String getAlias()

Implements javax.persistence.TupleElement.getAlias.

Doc from javax.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.

Returns:String

alias

Annotations
@Override
getHibernateTypeback to summary
public Type getHibernateType()
getJavaTypeback to summary
public Class<T> getJavaType()

Implements javax.persistence.TupleElement.getJavaType.

Doc from javax.persistence.TupleElement.getJavaType.

Return the Java type of the tuple element.

Returns:Class<T>

the Java type of the tuple element

Annotations
@Override
getPositionback to summary
public int getPosition()
org.hibernate.jpa.spi back to summary

public Class TupleBuilderTransformer.HqlTupleImpl

extends Object
implements Tuple
Class Inheritance
All Implemented Interfaces
javax.persistence.Tuple

Field Summary

Modifier and TypeField and Description
private Object[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <X> X
get(String
alias assigned to tuple element
alias
,
Class<X>
of the tuple element
type
)

Implements javax.persistence.Tuple.get.

Get the value of the tuple element to which the specified alias has been assigned.
public Object
get(String
alias assigned to tuple element
alias
)

Implements javax.persistence.Tuple.get.

Get the value of the tuple element to which the specified alias has been assigned.
public <X> X
get(int
position in result tuple
i
,
Class<X>
type of the tuple element
type
)

Implements javax.persistence.Tuple.get.

Get the value of the element at the specified position in the result tuple.
public Object
get(int
position in result tuple
i
)

Implements javax.persistence.Tuple.get.

Get the value of the element at the specified position in the result tuple.
public <X> X
get(TupleElement<X>
tuple element
tupleElement
)

Implements javax.persistence.Tuple.get.

Get the value of the specified tuple element.
public List<TupleElement<?>>
getElements()

Implements javax.persistence.Tuple.getElements.

Return the tuple elements.
public Object[]
toArray()

Implements javax.persistence.Tuple.toArray.

Return the values of the result tuple elements as an array.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

tupleback to summary
private Object[] tuple

Constructor Detail

HqlTupleImplback to summary
public HqlTupleImpl(Object[] tuple)

Method Detail

getback to summary
public <X> X get(String alias, Class<X> type)

Implements javax.persistence.Tuple.get.

Doc from javax.persistence.Tuple.get.

Get the value of the tuple element to which the specified alias has been assigned.

Parameters
alias:String

alias assigned to tuple element

type:Class<X>

of the tuple element

Returns:X

value of the tuple element

Annotations
@Override
getback to summary
public Object get(String alias)

Implements javax.persistence.Tuple.get.

Doc from javax.persistence.Tuple.get.

Get the value of the tuple element to which the specified alias has been assigned.

Parameters
alias:String

alias assigned to tuple element

Returns:Object

value of the tuple element

Annotations
@Override
getback to summary
public <X> X get(int i, Class<X> type)

Implements javax.persistence.Tuple.get.

Doc from javax.persistence.Tuple.get.

Get the value of the element at the specified position in the result tuple. The first position is 0.

Parameters
i:int

position in result tuple

type:Class<X>

type of the tuple element

Returns:X

value of the tuple element

Annotations
@Override
getback to summary
public Object get(int i)

Implements javax.persistence.Tuple.get.

Doc from javax.persistence.Tuple.get.

Get the value of the element at the specified position in the result tuple. The first position is 0.

Parameters
i:int

position in result tuple

Returns:Object

value of the tuple element

Annotations
@Override
getback to summary
public <X> X get(TupleElement<X> tupleElement)

Implements javax.persistence.Tuple.get.

Doc from javax.persistence.Tuple.get.

Get the value of the specified tuple element.

Parameters
tupleElement:TupleElement<X>

tuple element

Returns:X

value of tuple element

Annotations
@Override
getElementsback to summary
public List<TupleElement<?>> getElements()

Implements javax.persistence.Tuple.getElements.

Doc from javax.persistence.Tuple.getElements.

Return the tuple elements.

Returns:List<TupleElement<?>>

tuple elements

Annotations
@Override
toArrayback to summary
public Object[] toArray()

Implements javax.persistence.Tuple.toArray.

Doc from javax.persistence.Tuple.toArray.

Return the values of the result tuple elements as an array.

Returns:Object[]

tuple element values

Annotations
@Override