Top Description Methods
javax.persistence

public Interface Tuple

Imports
java.util.List

Interface for extracting the elements of a query result tuple.
Since
Java Persistence 2.0
See Also
TupleElement

Method Summary

Modifier and TypeMethod and Description
public <X> X

Returns:

value of tuple element
get
(TupleElement<X>
tuple element
tupleElement
)

Get the value of the specified tuple element.

public <X> X

Returns:

value of the tuple element
get
(String
alias assigned to tuple element
alias
,
Class<X>
of the tuple element
type
)

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

public Object

Returns:

value of the tuple element
get
(String
alias assigned to tuple element
alias
)

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

public <X> X

Returns:

value of the tuple element
get
(int
position in result tuple
i
,
Class<X>
type of the tuple element
type
)

Get the value of the element at the specified position in the result tuple.

public Object

Returns:

value of the tuple element
get
(int
position in result tuple
i
)

Get the value of the element at the specified position in the result tuple.

public List<TupleElement<?>>

Returns:

tuple elements
getElements
()

Return the tuple elements.

public Object[]

Returns:

tuple element values
toArray
()

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

Method Detail

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

Get the value of the specified tuple element.

Parameters
tupleElement:TupleElement<X>

tuple element

Returns:X

value of tuple element

Exceptions
IllegalArgumentException:
if tuple element does not correspond to an element in the query result tuple
getback to summary
public <X> X get(String alias, Class<X> type)

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

Exceptions
IllegalArgumentException:
if alias does not correspond to an element in the query result tuple or element cannot be assigned to the specified type
getback to summary
public Object get(String alias)

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

Exceptions
IllegalArgumentException:
if alias does not correspond to an element in the query result tuple
getback to summary
public <X> X get(int i, Class<X> type)

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

Exceptions
IllegalArgumentException:
if i exceeds length of result tuple or element cannot be assigned to the specified type
getback to summary
public Object get(int i)

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

Exceptions
IllegalArgumentException:
if i exceeds length of result tuple
getElementsback to summary
public List<TupleElement<?>> getElements()

Return the tuple elements.

Returns:List<TupleElement<?>>

tuple elements

toArrayback to summary
public Object[] toArray()

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

Returns:Object[]

tuple element values