multiselect(selections) - JPA CriteriaQuery's method
Method javax.persistence.criteria.CriteriaQuery
CriteriaQuery<T> multiselect(
Selection... selections
)
An argument to the multiselect method must not be a tuple- or array-valued compound selection item.
The semantics of this method are as follows:
- If the type of the criteria query is
CriteriaQuery
(i.e., a criteria query object created by either thecreateTupleQuery
method or by passing aTuple
class argument to thecreateQuery
method), aTuple
object corresponding to the arguments of themultiselect
method, in the specified order, will be instantiated and returned for each row that results from the query execution. - If the type of the criteria query is
CriteriaQuery
for some user-defined class X (i.e., a criteria query object created by passing a X class argument to thecreateQuery
method), the arguments to themultiselect
method will be passed to the X constructor and an instance of type X will be returned for each row. - If the type of the criteria query is
CriteriaQuery
for some class X, an instance of type X[] will be returned for each row. The elements of the array will correspond to the arguments of themultiselect
method, in the specified order. - If the type of the criteria query is
CriteriaQuery or if the criteria query was created without specifying a type, and only a single argument is passed to the
multiselect
method, an instance of typeObject
will be returned for each row.- If the type of the criteria query is
CriteriaQuery or if the criteria query was created without specifying a type, and more than one argument is passed to the
multiselect
method, an instance of typeObject[]
will be instantiated and returned for each row. The elements of the array will correspond to the arguments to themultiselect
method, in the specified order.- Parameters:
-
selections
- selection items corresponding to the results to be returned by the query
- Returns:
- the modified query
- Throws:
-
IllegalArgumentException
- if a selection item is not valid or if more than one selection item has the same assigned alias
- Since:
- JPA 2.0
- If the type of the criteria query is