Top Description Methods
javax.persistence.criteria

public Interface Selection<X>

extends TupleElement<X>
Known Direct Subinterfaces
javax.persistence.criteria.CompoundSelection, javax.persistence.criteria.Expression
Type Parameters
<X>
the type of the selection item
Imports
javax.persistence.TupleElement, java.util.List

The Selection interface defines an item that is to be returned in a query result.
Since
Java Persistence 2.0

Method Summary

Modifier and TypeMethod and Description
public Selection<X>

Returns:

selection item
alias
(String
alias
name
)

Assigns an alias to the selection item.

public List<Selection<?>>

Returns:

list of selection items
getCompoundSelectionItems
()

Return the selection items composing a compound selection.

public boolean

Returns:

boolean indicating whether the selection is a compound selection
isCompoundSelection
()

Whether the selection item is a compound selection.

Inherited from javax.persistence.TupleElement:
getAliasgetJavaType

Method Detail

aliasback to summary
public Selection<X> alias(String name)

Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item.

Parameters
name:String

alias

Returns:Selection<X>

selection item

getCompoundSelectionItemsback to summary
public List<Selection<?>> getCompoundSelectionItems()

Return the selection items composing a compound selection. Modifications to the list do not affect the query.

Returns:List<Selection<?>>

list of selection items

Exceptions
IllegalStateException:
if selection is not a compound selection
isCompoundSelectionback to summary
public boolean isCompoundSelection()

Whether the selection item is a compound selection.

Returns:boolean

boolean indicating whether the selection is a compound selection