">List<X>.">
Jakarta Persistence (JPA) Method

List<X> getResultList()


Execute a SELECT query and return the query results as a typed List<X>.
Returns:
a list of the results, each of type X, or an empty list if there are no results.
Throws:
IllegalStateException - if called for a Jakarta Persistence query language UPDATE or DELETE statement.
PessimisticLockException - if pessimistic locking fails and the transaction is rolled back.
LockTimeoutException - if pessimistic locking fails and only the statement is rolled back.
PersistenceException - if the query execution exceeds the query timeout value set and the transaction is rolled back.
TransactionRequiredException - if a lock mode other than NONE has been set and there is no transaction or the persistence context has not been joined to the transaction.
QueryTimeoutException - if the query execution exceeds the query timeout value set and only the statement is rolled back.
Since:
Jakarta Persistence (JPA) 1.0