com.mysema.query.jpa.sql
Class AbstractJPASQLQuery<Q extends AbstractJPASQLQuery<Q>>

java.lang.Object
  extended by com.mysema.query.support.QueryBase<Q>
      extended by com.mysema.query.support.ProjectableQuery<T>
          extended by com.mysema.query.jpa.AbstractSQLQuery<Q>
              extended by com.mysema.query.jpa.sql.AbstractJPASQLQuery<Q>
Type Parameters:
Q -
All Implemented Interfaces:
Projectable
Direct Known Subclasses:
JPASQLQuery

public abstract class AbstractJPASQLQuery<Q extends AbstractJPASQLQuery<Q>>
extends AbstractSQLQuery<Q>

Author:
tiwe

Field Summary
protected  SQLTemplates sqlTemplates
           
 
Fields inherited from class com.mysema.query.support.QueryBase
queryMixin
 
Constructor Summary
AbstractJPASQLQuery(javax.persistence.EntityManager entityManager, SQLTemplates sqlTemplates)
           
AbstractJPASQLQuery(JPASessionHolder session, SQLTemplates sqlTemplates, QueryMetadata metadata)
           
 
Method Summary
 javax.persistence.Query createQuery(Expression<?>... args)
           
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expression<?>[] args)
          iterate over the results for the given projection
<RT> com.mysema.commons.lang.CloseableIterator<RT>
iterate(Expression<RT> projection)
          iterate over the results for the given projection
 List<Object[]> list(Expression<?>[] args)
          list the results for the given projection An empty list is returned for no results.
<RT> List<RT>
list(Expression<RT> projection)
          list the results for the given projection An empty list is returned for no results.
<RT> SearchResults<RT>
listResults(Expression<RT> projection)
          list the results for the given projection
protected  void logQuery(String queryString)
           
protected  void reset()
           
protected  String toCountRowsString()
           
protected  String toQueryString()
           
 Object[] uniqueResult(Expression<?>[] args)
          return a unique result for the given projection or null if no result is found
<RT> RT
uniqueResult(Expression<RT> expr)
          return a unique result for the given projection or null if no result is found
 
Methods inherited from class com.mysema.query.jpa.AbstractSQLQuery
addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, count, exists, from, from, fullJoin, fullJoin, fullJoin, getMetadata, innerJoin, innerJoin, innerJoin, join, join, join, leftJoin, leftJoin, leftJoin, on, rightJoin, rightJoin, rightJoin
 
Methods inherited from class com.mysema.query.support.ProjectableQuery
countDistinct, iterate, iterateDistinct, iterateDistinct, iterateDistinct, list, listDistinct, listDistinct, listDistinct, listDistinctResults, map, notExists, singleResult, singleResult, singleResult, uniqueResult, uniqueResult
 
Methods inherited from class com.mysema.query.support.QueryBase
distinct, groupBy, having, limit, offset, orderBy, restrict, set, toString, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sqlTemplates

protected final SQLTemplates sqlTemplates
Constructor Detail

AbstractJPASQLQuery

public AbstractJPASQLQuery(javax.persistence.EntityManager entityManager,
                           SQLTemplates sqlTemplates)

AbstractJPASQLQuery

public AbstractJPASQLQuery(JPASessionHolder session,
                           SQLTemplates sqlTemplates,
                           QueryMetadata metadata)
Method Detail

createQuery

public javax.persistence.Query createQuery(Expression<?>... args)

list

public List<Object[]> list(Expression<?>[] args)
Description copied from interface: Projectable
list the results for the given projection An empty list is returned for no results.

Specified by:
list in interface Projectable
Overrides:
list in class ProjectableQuery<Q extends AbstractJPASQLQuery<Q>>
Returns:

list

public <RT> List<RT> list(Expression<RT> projection)
Description copied from interface: Projectable
list the results for the given projection An empty list is returned for no results.

Specified by:
list in interface Projectable
Overrides:
list in class ProjectableQuery<Q extends AbstractJPASQLQuery<Q>>
Type Parameters:
RT - generic type of the List
Returns:
a List over the projection

iterate

public com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expression<?>[] args)
Description copied from interface: Projectable
iterate over the results for the given projection

Returns:

iterate

public <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Expression<RT> projection)
Description copied from interface: Projectable
iterate over the results for the given projection

Type Parameters:
RT - generic type of the Iterator
Returns:
an Iterator over the projection

listResults

public <RT> SearchResults<RT> listResults(Expression<RT> projection)
Description copied from interface: Projectable
list the results for the given projection

Returns:

logQuery

protected void logQuery(String queryString)

reset

protected void reset()

toCountRowsString

protected String toCountRowsString()

toQueryString

protected String toQueryString()

uniqueResult

public <RT> RT uniqueResult(Expression<RT> expr)
Description copied from interface: Projectable
return a unique result for the given projection or null if no result is found

Type Parameters:
RT - return type
Returns:
the result or null for an empty result

uniqueResult

public Object[] uniqueResult(Expression<?>[] args)
Description copied from interface: Projectable
return a unique result for the given projection or null if no result is found

Returns:


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.