EclipseLink 2.0.0_ 2.0.0.v20090424-r4050 API Reference

javax.persistence
Interface Result


public interface Result

Interface for extracting the result items from a typed query result.

Since:
Java Persistence 2.0

Method Summary
 java.lang.Object get(int i)
          Get the value of the item at the specified position in the result list.
<X> X
get(int i, java.lang.Class<X> type)
          Get the value of the item at the specified position in the result list.
<X> X
get(ResultItem<X> resultItem)
          Get the value of the specified result item.
<X> X
get(java.lang.String alias, java.lang.Class<X> type)
          Get the value of the result list item to which the specified alias has been assigned.
 java.lang.Object[] toArray()
          Return the values of the result list items as an array.
 

Method Detail

get

<X> X get(ResultItem<X> resultItem)
Get the value of the specified result item.

Parameters:
resultItem - result list item
Returns:
value of result list item
Throws:
IllegalArgument - exception if result item does not correspond to an item in the query result

get

<X> X get(java.lang.String alias,
          java.lang.Class<X> type)
Get the value of the result list item to which the specified alias has been assigned.

Parameters:
alias - alias assigned to result list item
Returns:
type of the result list item
Throws:
IllegalArgument - exception if alias does not correspond to an item in the query result or type is incorrect

get

<X> X get(int i,
          java.lang.Class<X> type)
Get the value of the item at the specified position in the result list. The first position is 0.

Parameters:
i - position in result list
type - type of the result list item
Returns:
value of the result list item
Throws:
IllegalArgument - exception if i exceeds length of result list of type is incorrect

get

java.lang.Object get(int i)
Get the value of the item at the specified position in the result list. The first position is 0.

Parameters:
i - position in result list
Returns:
value of the result item
Throws:
IllegalArgument - exception if i exceeds length of result list

toArray

java.lang.Object[] toArray()
Return the values of the result list items as an array.

Returns:
result list values

EclipseLink 2.0.0_ 2.0.0.v20090424-r4050 API Reference