Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam Core JSF2 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.seam.framework
Class EntityQuery<E>

    java.lang.Object
      org.jboss.seam.framework.Controller
          org.jboss.seam.framework.PersistenceController<T>
              org.jboss.seam.framework.Query<javax.persistence.EntityManager,E>
                  org.jboss.seam.framework.EntityQuery<E>

All Implemented Interfaces:
  Serializable

    public class EntityQuery<E>

extends Query<javax.persistence.EntityManager,E>

A Query object for JPA.

Author:
  Gavin King
See Also:
  Serialized Form

Constructor Summary
`EntityQuery()`

Method Summary
`protected javax.persistence.Query` | `createCountQuery()`
`protected javax.persistence.Query` | `createQuery()`
`javax.persistence.EntityManager` | `getEntityManager()`
`Map<String,String>` | `getHints()`
`protected String` | `getPersistenceContextName()`
`Long` | `getResultCount()` Get the number of results this query returns Any changed restriction values will be applied
`List<E>` | `getResultList()` Get the list of results this query returns Any changed restriction values will be applied
`E` | `getSingleResult()` Get a single result from the query Any changed restriction values will be applied
`boolean` | `isNextExists()` Returns true if next page exists
`protected void` | `joinTransaction()`
`void` | `refresh()` The refresh method will cause the result to be cleared.
`void` | `setEntityManager(javax.persistence.EntityManager entityManager)`
`void` | `setHints(Map<String,String> hints)`
`void` | `validate()` Validate the query

Methods inherited from class org.jboss.seam.framework.Query
`clearDataModel, evaluateAllParameters, first, getCountEjbql, getDataModel, getDataModelSelection, getDataModelSelectionIndex, getEjbql, getFirstResult, getGroupBy, getLastFirstResult, getMaxResults, getNextFirstResult, getOrder, getOrderColumn, getOrderDirection, getPageCount, getPreviousFirstResult, getQueryParameters, getQueryParameterValues, getRenderedEjbql, getRestrictionExpressionStrings, getRestrictionLogicOperator, getRestrictionParameters, getRestrictionParameterValues, getRestrictions, isAnyParameterDirty, isPaginated, isPreviousExists, isRestrictionParameterSet, isUseWildcardAsCountQuerySubject, last, next, parseEjbql, previous, setEjbql, setFirstResult, setGroupBy, setMaxResults, setOrder, setOrderColumn, setOrderDirection, setQueryParameterValues, setRestrictionExpressionStrings, setRestrictionLogicOperator, setRestrictionParameterValues, setRestrictions, setUseWildcardAsCountQuerySubject, truncResultList`

Methods inherited from class org.jboss.seam.framework.PersistenceController
`getPersistenceContext, setPersistenceContext`

Methods inherited from class org.jboss.seam.framework.Controller
`addCookie, addFacesMessage, addFacesMessageFromResourceBundle, createValueExpression, createValueExpression, debug, debug, error, error, evaluateValueExpression, evaluateValueExpression, failValidation, fatal, fatal, getApplicationContext, getBusinessProcessContext, getComponentInstance, getComponentInstance, getConversation, getConversationContext, getCookie, getEventContext, getEvents, getFacesContext, getFacesMessages, getIdentity, getLog, getMessages, getMethodContext, getPageContext, getRedirect, getSessionContext, getStatusMessages, getValidator, getValidator, info, info, interpolate, invalidateSession, isTransactionMarkedRollback, raiseAsynchronousEvent, raiseEvent, raiseTransactionSuccessEvent, render, sendHttpError, sendHttpError, trace, trace, validationFailed, validationSucceeded, warn, warn`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### EntityQuery

    public EntityQuery()

Method Detail

### validate

    public void validate()

  Validate the query

  Overrides:
    `validate` in class `Query<javax.persistence.EntityManager,E>`
  Throws:
    `IllegalStateException` - if the query is not valid

### isNextExists

    @Transactional
    public boolean isNextExists()

  Description copied from class: `Query`
  Returns true if next page exists

  Specified by:
    `isNextExists` in class `Query<javax.persistence.EntityManager,E>`

### getResultList

    @Transactional
    public List<E> getResultList()

  Get the list of results this query returns Any changed restriction values will be applied

  Specified by:
    `getResultList` in class `Query<javax.persistence.EntityManager,E>`

### getSingleResult

    @Transactional
    public E getSingleResult()

  Get a single result from the query Any changed restriction values will be applied

  Specified by:
    `getSingleResult` in class `Query<javax.persistence.EntityManager,E>`
  Throws:
    `javax.persistence.NonUniqueResultException` - if there is more than one result

### getResultCount

    @Transactional
    public Long getResultCount()

  Get the number of results this query returns Any changed restriction values will be applied

  Specified by:
    `getResultCount` in class `Query<javax.persistence.EntityManager,E>`

### refresh

    public void refresh()

  The refresh method will cause the result to be cleared. The next access to the result set will cause the query to be executed. This method does not cause the ejbql or restrictions to reread. If you want to update the ejbql or restrictions you must call `Query.setEjbql(String)` or `Query.setRestrictions(List)`

  Overrides:
    `refresh` in class `Query<javax.persistence.EntityManager,E>`

### getEntityManager

    public javax.persistence.EntityManager getEntityManager()

### setEntityManager

    public void setEntityManager(javax.persistence.EntityManager entityManager)

### getPersistenceContextName

    protected String getPersistenceContextName()

  Specified by:
    `getPersistenceContextName` in class `PersistenceController<javax.persistence.EntityManager>`

### createQuery

    protected javax.persistence.Query createQuery()

### createCountQuery

    protected javax.persistence.Query createCountQuery()

### getHints

    public Map<String,String> getHints()

### setHints

    public void setHints(Map<String,String> hints)

### joinTransaction

    protected void joinTransaction()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam Core JSF2 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 Seam Framework. All Rights Reserved.