com.mysema.query.sql
Class AbstractSQLQuery<SubType extends AbstractSQLQuery<SubType>>

java.lang.Object
  extended by com.mysema.query.QueryBase<SubType>
      extended by com.mysema.query.support.ProjectableQuery<SubType>
          extended by com.mysema.query.sql.AbstractSQLQuery<SubType>
All Implemented Interfaces:
Projectable
Direct Known Subclasses:
OracleQuery, SQLQueryImpl

public abstract class AbstractSQLQuery<SubType extends AbstractSQLQuery<SubType>>
extends ProjectableQuery<SubType>

AbstractSqlQuery is the base type for SQL query implementations

Version:
$Id$
Author:
tiwe

Nested Class Summary
 class AbstractSQLQuery.UnionBuilder<RT>
           
 
Field Summary
protected  SQLTemplates templates
           
 
Fields inherited from class com.mysema.query.QueryBase
queryMixin
 
Constructor Summary
AbstractSQLQuery(Connection conn, SQLTemplates templates)
           
 
Method Summary
protected  String buildQueryString(boolean forCountRow)
           
 long count()
          return the amount of matched rows
protected  SQLSerializer createSerializer()
           
 SubType from(PEntity<?>... args)
           
 SubType fullJoin(PEntity<?> target)
           
 SubType innerJoin(PEntity<?> target)
           
 Iterator<Object[]> iterate(Expr<?>[] args)
          iterate over the results for the given projection
<RT> Iterator<RT>
iterate(Expr<RT> projection)
          iterate over the results for the given projection
 SubType join(PEntity<?> target)
           
 SubType leftJoin(PEntity<?> target)
           
 List<Object[]> list(Expr<?>[] args)
          list the results for the given projection
<RT> List<RT>
list(Expr<RT> expr)
          list the results for the given projection
<RT> SearchResults<RT>
listResults(Expr<RT> expr)
          list the results for the given projection
 SubType on(EBoolean... conditions)
           
protected  String toQueryString()
           
 String toString()
           
<RT> AbstractSQLQuery.UnionBuilder<RT>
union(ListSubQuery<RT>... sq)
           
<RT> AbstractSQLQuery.UnionBuilder<RT>
union(ObjectSubQuery<RT>... sq)
           
<RT> RT
uniqueResult(Expr<RT> expr)
          return a unique result for the given projection
 
Methods inherited from class com.mysema.query.support.ProjectableQuery
countDistinct, iterate, iterateDistinct, iterateDistinct, iterateDistinct, list, listDistinct, listDistinct, listDistinct, listDistinctResults, map, uniqueResult, uniqueResult
 
Methods inherited from class com.mysema.query.QueryBase
groupBy, having, limit, offset, orderBy, restrict, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

templates

protected final SQLTemplates templates
Constructor Detail

AbstractSQLQuery

public AbstractSQLQuery(Connection conn,
                        SQLTemplates templates)
Method Detail

buildQueryString

protected String buildQueryString(boolean forCountRow)

count

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


createSerializer

protected SQLSerializer createSerializer()

from

public SubType from(PEntity<?>... args)

fullJoin

public SubType fullJoin(PEntity<?> target)

innerJoin

public SubType innerJoin(PEntity<?> target)

iterate

public Iterator<Object[]> iterate(Expr<?>[] args)
Description copied from interface: Projectable
iterate over the results for the given projection

Returns:

iterate

public <RT> Iterator<RT> iterate(Expr<RT> projection)
Description copied from interface: Projectable
iterate over the results for the given projection

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

join

public SubType join(PEntity<?> target)

leftJoin

public SubType leftJoin(PEntity<?> target)

list

public List<Object[]> list(Expr<?>[] args)
Description copied from interface: Projectable
list the results for the given projection

Specified by:
list in interface Projectable
Overrides:
list in class ProjectableQuery<SubType extends AbstractSQLQuery<SubType>>
Returns:

list

public <RT> List<RT> list(Expr<RT> expr)
Description copied from interface: Projectable
list the results for the given projection

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

listResults

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

Returns:

on

public SubType on(EBoolean... conditions)

toQueryString

protected String toQueryString()

toString

public String toString()
Overrides:
toString in class QueryBase<SubType extends AbstractSQLQuery<SubType>>

union

public <RT> AbstractSQLQuery.UnionBuilder<RT> union(ListSubQuery<RT>... sq)

union

public <RT> AbstractSQLQuery.UnionBuilder<RT> union(ObjectSubQuery<RT>... sq)

uniqueResult

public <RT> RT uniqueResult(Expr<RT> expr)
Description copied from interface: Projectable
return a unique result for the given projection

Specified by:
uniqueResult in interface Projectable
Overrides:
uniqueResult in class ProjectableQuery<SubType extends AbstractSQLQuery<SubType>>
Type Parameters:
RT - return type
Returns:
the result or null for an empty result


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