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

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

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

AbstractSQLQuery is the base type for SQL query implementations

Version:
$Id$
Author:
tiwe

Nested Class Summary
 class AbstractSQLQuery.UnionBuilder<RT>
           
 
Field Summary
 
Fields inherited from class com.mysema.query.support.QueryBase
queryMixin
 
Constructor Summary
AbstractSQLQuery(Connection conn, SQLTemplates templates)
           
AbstractSQLQuery(Connection conn, SQLTemplates templates, QueryMetadata metadata)
           
 
Method Summary
protected  String buildQueryString(boolean forCountRow)
           
 long count()
          return the amount of matched rows
protected  SQLSerializer createSerializer()
           
 Q from(Expr<?>... args)
           
 Q fullJoin(PEntity<?> target)
           
 Q fullJoin(SubQuery<?> target, Path<?> alias)
           
 QueryMetadata getMetadata()
           
 ResultSet getResults(Expr<?>... exprs)
           
protected  SQLTemplates getTemplates()
           
 Q innerJoin(PEntity<?> target)
           
 Q innerJoin(SubQuery<?> target, Path<?> alias)
           
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?>[] args)
          iterate over the results for the given projection
<RT> com.mysema.commons.lang.CloseableIterator<RT>
iterate(Expr<RT> expr)
          iterate over the results for the given projection
 Q join(PEntity<?> target)
           
 Q join(SubQuery<?> target, Path<?> alias)
           
 Q leftJoin(PEntity<?> target)
           
 Q leftJoin(SubQuery<?> target, Path<?> alias)
           
 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
 Q on(EBoolean... conditions)
           
 Q rightJoin(PEntity<?> target)
           
 Q rightJoin(SubQuery<?> target, Path<?> alias)
           
 String toString()
           
<RT> AbstractSQLQuery.UnionBuilder<RT>
union(ListSubQuery<RT>... sq)
           
<RT> AbstractSQLQuery.UnionBuilder<RT>
union(SubQuery<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.support.QueryBase
groupBy, having, limit, offset, orderBy, restrict, set, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractSQLQuery

public AbstractSQLQuery(@Nullable
                        Connection conn,
                        SQLTemplates templates)

AbstractSQLQuery

public AbstractSQLQuery(@Nullable
                        Connection conn,
                        SQLTemplates templates,
                        QueryMetadata metadata)
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 Q from(Expr<?>... args)

fullJoin

public Q fullJoin(PEntity<?> target)

fullJoin

public Q fullJoin(SubQuery<?> target,
                  Path<?> alias)

getMetadata

public QueryMetadata getMetadata()

getResults

public ResultSet getResults(Expr<?>... exprs)

getTemplates

protected SQLTemplates getTemplates()

innerJoin

public Q innerJoin(PEntity<?> target)

innerJoin

public Q innerJoin(SubQuery<?> target,
                   Path<?> alias)

iterate

public com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?>[] 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(Expr<RT> expr)
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 Q join(PEntity<?> target)

join

public Q join(SubQuery<?> target,
              Path<?> alias)

leftJoin

public Q leftJoin(PEntity<?> target)

leftJoin

public Q leftJoin(SubQuery<?> target,
                  Path<?> alias)

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<Q extends AbstractSQLQuery<Q>>
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<Q extends AbstractSQLQuery<Q>>
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 Q on(EBoolean... conditions)

rightJoin

public Q rightJoin(PEntity<?> target)

rightJoin

public Q rightJoin(SubQuery<?> target,
                   Path<?> alias)

toString

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

union

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

union

public <RT> AbstractSQLQuery.UnionBuilder<RT> union(SubQuery<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<Q extends AbstractSQLQuery<Q>>
Type Parameters:
RT - return type
Returns:
the result or null for an empty result


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