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

public Class NativeQueryTupleTransformer

extends BasicTransformerAdapter
Class Inheritance
Imports
java.util.ArrayList, .LinkedHashMap, .List, .Map, javax.persistence.Tuple, .TupleElement, org.hibernate.HibernateException, org.hibernate.transform.BasicTransformerAdapter

ResultTransformer adapter for handling Tuple results from Native queries
Author
Arnold Galovics

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
public

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

Constructor Detail

NativeQueryTupleTransformerback to summary
public NativeQueryTupleTransformer()

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

private Class NativeQueryTupleTransformer.NativeTupleElementImpl<X>

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

Field Summary

Modifier and TypeField and Description
private final String
private final Class<? extends X>

Constructor Summary

AccessConstructor and Description
public
NativeTupleElementImpl(Class<? extends X> javaType, String alias)

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 Class<? extends X>
getJavaType()

Implements javax.persistence.TupleElement.getJavaType.

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

Field Detail

aliasback to summary
private final String alias
javaTypeback to summary
private final Class<? extends X> javaType

Constructor Detail

NativeTupleElementImplback to summary
public NativeTupleElementImpl(Class<? extends X> javaType, String alias)

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
getJavaTypeback to summary
public Class<? extends X> getJavaType()

Implements javax.persistence.TupleElement.getJavaType.

Doc from javax.persistence.TupleElement.getJavaType.

Return the Java type of the tuple element.

Returns:Class<? extends X>

the Java type of the tuple element

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

private Class NativeQueryTupleTransformer.NativeTupleImpl

extends Object
implements Tuple
Class Inheritance
  • java.lang.Object
  • org.hibernate.jpa.spi.NativeQueryTupleTransformer.NativeTupleImpl
All Implemented Interfaces
javax.persistence.Tuple

Field Summary

Modifier and TypeField and Description
private Map<String, String>
private Map<String, Object>
private Object[]

Constructor Summary

AccessConstructor and Description
public
NativeTupleImpl(Object[] tuple, String[] aliases)

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.
private Class<?>
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

aliasReferencesback to summary
private Map<String, String> aliasReferences
aliasToValueback to summary
private Map<String, Object> aliasToValue
tupleback to summary
private Object[] tuple

Constructor Detail

NativeTupleImplback to summary
public NativeTupleImpl(Object[] tuple, String[] aliases)

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
getValueClassback to summary
private Class<?> getValueClass(Object value)
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