com.mysema.query.jdo.sql
Class JDOSQLQuery

java.lang.Object
  extended by com.mysema.query.support.QueryBase<Q>
      extended by com.mysema.query.support.ProjectableQuery<T>
          extended by com.mysema.query.jdo.sql.AbstractSQLQuery<JDOSQLQuery>
              extended by com.mysema.query.jdo.sql.JDOSQLQuery
All Implemented Interfaces:
FilteredClause<JDOSQLQuery>, Projectable, Query<JDOSQLQuery>, SimpleQuery<JDOSQLQuery>, SQLCommonQuery<JDOSQLQuery>

public final class JDOSQLQuery
extends AbstractSQLQuery<JDOSQLQuery>
implements SQLCommonQuery<JDOSQLQuery>

JDOSQLQuery is an SQLQuery implementation that uses JDO's SQL query functionality to execute queries

Author:
tiwe

Field Summary
 
Fields inherited from class com.mysema.query.jdo.sql.AbstractSQLQuery
queryMixin, templates, union, unionAll
 
Constructor Summary
JDOSQLQuery(javax.jdo.PersistenceManager persistenceManager, SQLTemplates templates)
           
JDOSQLQuery(javax.jdo.PersistenceManager persistenceManager, SQLTemplates templates, QueryMetadata metadata, boolean detach)
           
 
Method Summary
 void close()
           
 long count()
          return the amount of matched rows
 QueryMetadata getMetadata()
           
 boolean isDetach()
           
 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> expr)
          list the results for the given projection An empty list is returned for no results.
<RT> SearchResults<RT>
listResults(Expression<RT> expr)
          list the results for the given projection
 String toString()
           
 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.jdo.sql.AbstractSQLQuery
addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, exists, from, from, fullJoin, fullJoin, fullJoin, fullJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, on, rightJoin, rightJoin, rightJoin, rightJoin, union, union, union, union, unionAll, unionAll, unionAll, unionAll
 
Methods inherited from class com.mysema.query.support.ProjectableQuery
countDistinct, iterate, iterateDistinct, iterateDistinct, iterateDistinct, list, listDistinct, listDistinct, listDistinct, listDistinctResults, map, notExists, singleResult, singleResult, singleResult, transform, uniqueResult, uniqueResult
 
Methods inherited from class com.mysema.query.support.QueryBase
distinct, equals, groupBy, hashCode, having, limit, offset, orderBy, restrict, set, where
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.sql.SQLCommonQuery
addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, from, from, fullJoin, fullJoin, fullJoin, fullJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, on, rightJoin, rightJoin, rightJoin, rightJoin
 
Methods inherited from interface com.mysema.query.Query
groupBy, having
 
Methods inherited from interface com.mysema.query.SimpleQuery
distinct, limit, offset, orderBy, restrict, set
 
Methods inherited from interface com.mysema.query.FilteredClause
where
 

Constructor Detail

JDOSQLQuery

public JDOSQLQuery(@Nullable
                   javax.jdo.PersistenceManager persistenceManager,
                   SQLTemplates templates)

JDOSQLQuery

public JDOSQLQuery(@Nullable
                   javax.jdo.PersistenceManager persistenceManager,
                   SQLTemplates templates,
                   QueryMetadata metadata,
                   boolean detach)
Method Detail

close

public void close()

count

public long count()
Description copied from interface: Projectable
return the amount of matched rows

Specified by:
count in interface Projectable
Overrides:
count in class AbstractSQLQuery<JDOSQLQuery>

getMetadata

public QueryMetadata getMetadata()
Overrides:
getMetadata in class AbstractSQLQuery<JDOSQLQuery>

isDetach

public boolean isDetach()

iterate

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

Specified by:
iterate in interface Projectable
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

Specified by:
iterate in interface Projectable
Type Parameters:
RT - generic type of the Iterator
Returns:
an Iterator over the projection

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<JDOSQLQuery>
Returns:

list

public <RT> List<RT> list(Expression<RT> expr)
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<JDOSQLQuery>
Type Parameters:
RT - generic type of the List
Returns:
a List over the projection

listResults

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

Specified by:
listResults in interface Projectable
Returns:

toString

public String toString()
Overrides:
toString in class QueryBase<JDOSQLQuery>

uniqueResult

@Nullable
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

There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.

Specified by:
uniqueResult in interface Projectable
Type Parameters:
RT - return type
Returns:
the result or null for an empty result

uniqueResult

@Nullable
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

There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.

Specified by:
uniqueResult in interface Projectable
Returns:


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