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

public Class NativeQueryTupleTransformer

extends Object
implements ResultTransformer<Tuple>, TypedTupleTransformer<Tuple>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.TypedTupleTransformer, org.hibernate.query.TupleTransformer, org.hibernate.transform.ResultTransformer, java.io.Serializable, org.hibernate.query.ResultListTransformer
Imports
java.util.ArrayList, .Arrays, .LinkedHashMap, .List, .Map, jakarta.persistence.Tuple, .TupleElement, org.hibernate.HibernateException, org.hibernate.query.TypedTupleTransformer, org.hibernate.transform.ResultTransformer

Deprecated

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

A ResultTransformer for handling JPA Tuple results from native queries.
Author
Arnold Galovics

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
public static final NativeQueryTupleTransformer
INSTANCE

Deprecated as a consequence of NativeQueryTupleTransformer being deprecated.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<Tuple>
getTransformedType()

Implements org.hibernate.query.TypedTupleTransformer.getTransformedType.

The type resulting from this transformation
public Tuple
transformTuple(Object[]
The result elements
tuple
,
String[]
The result aliases ("parallel" array to tuple)
aliases
)

Implements org.hibernate.query.TupleTransformer.transformTuple.

Tuples are the elements making up each "row" of the query result.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final NativeQueryTupleTransformer INSTANCE

Deprecated

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

Constructor Detail

NativeQueryTupleTransformerback to summary
public NativeQueryTupleTransformer()

Method Detail

getTransformedTypeback to summary
public Class<Tuple> getTransformedType()

Implements org.hibernate.query.TypedTupleTransformer.getTransformedType.

Doc from org.hibernate.query.TypedTupleTransformer.getTransformedType.

The type resulting from this transformation

Annotations
@Override
transformTupleback to summary
public Tuple transformTuple(Object[] tuple, String[] aliases)

Implements org.hibernate.query.TupleTransformer.transformTuple.

Doc from org.hibernate.query.TupleTransformer.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 shape.

Parameters
tuple:Object[]

The result elements

aliases:String[]

The result aliases ("parallel" array to tuple)

Returns:Tuple

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
jakarta.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 jakarta.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 jakarta.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 jakarta.persistence.TupleElement.getAlias.

Doc from jakarta.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 jakarta.persistence.TupleElement.getJavaType.

Doc from jakarta.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
jakarta.persistence.Tuple

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private final Map<String, Object>
private final int
private final 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 jakarta.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 jakarta.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 jakarta.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 jakarta.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 jakarta.persistence.Tuple.get.

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

Implements jakarta.persistence.Tuple.getElements.

Return the tuple elements.
private Class<?>
public Object[]
toArray()

Implements jakarta.persistence.Tuple.toArray.

Return the values of the result tuple elements as an array.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

aliasReferencesback to summary
private final Map<String, String> aliasReferences
aliasToValueback to summary
private final Map<String, Object> aliasToValue
sizeback to summary
private final int size
tupleback to summary
private final 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 jakarta.persistence.Tuple.get.

Doc from jakarta.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 jakarta.persistence.Tuple.get.

Doc from jakarta.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 jakarta.persistence.Tuple.get.

Doc from jakarta.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 jakarta.persistence.Tuple.get.

Doc from jakarta.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 jakarta.persistence.Tuple.get.

Doc from jakarta.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 jakarta.persistence.Tuple.getElements.

Doc from jakarta.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 jakarta.persistence.Tuple.toArray.

Doc from jakarta.persistence.Tuple.toArray.

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

Returns:Object[]

tuple element values

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override