org.datanucleus.jdo.query
Class JDOTypesafeSubquery<T>

java.lang.Object
  extended by org.datanucleus.jdo.query.AbstractTypesafeQuery<T>
      extended by org.datanucleus.jdo.query.JDOTypesafeSubquery<T>
All Implemented Interfaces:
TypesafeSubquery<T>

public class JDOTypesafeSubquery<T>
extends AbstractTypesafeQuery<T>
implements TypesafeSubquery<T>

Implementation of a typesafe subquery for JDO. TODO JDOQL subqueries only allow result and filter, and JPQL subqueries allow result, filter, grouping, having.


Field Summary
 
Fields inherited from class org.datanucleus.jdo.query.AbstractTypesafeQuery
candidateAlias, candidateCls, filter, grouping, having, om, ordering, pm, result, resultDistinct
 
Constructor Summary
JDOTypesafeSubquery(javax.jdo.PersistenceManager pm, java.lang.Class<T> candidateClass, java.lang.String candidateAlias, JDOTypesafeQuery parentQuery)
           
 
Method Summary
 PersistableExpression candidate()
          Method to return an expression for the candidate of the subquery.
 TypesafeSubquery filter(BooleanExpression expr)
          Method to set the filter of the query.
 java.lang.String getAlias()
           
 TypesafeSubquery groupBy(Expression... exprs)
          Method to set the grouping(s) for the query.
 TypesafeSubquery having(Expression expr)
          Method to set the having clause of the query.
protected  Expression internalSelect(Expression expr, java.lang.Class implClass)
           
 CollectionExpression select(CollectionExpression expr)
          Accessor for the subquery (collection) expression from the subquery.
 CharacterExpression selectUnique(CharacterExpression expr)
          Accessor for the subquery (character) expression from the subquery when the subquery returns a single value.
<S> DateExpression<S>
selectUnique(DateExpression<S> expr)
          Accessor for the subquery (date) expression from the subquery when the subquery returns a single value.
<S> DateTimeExpression<S>
selectUnique(DateTimeExpression<S> expr)
          Accessor for the subquery (datetime) expression from the subquery when the subquery returns a single value.
<S> NumericExpression<S>
selectUnique(NumericExpression<S> expr)
          Accessor for the subquery (numeric) expression from the subquery when the subquery returns a single value.
 StringExpression selectUnique(StringExpression expr)
          Accessor for the subquery (string) expression from the subquery when the subquery returns a single value.
<S> TimeExpression<S>
selectUnique(TimeExpression<S> expr)
          Accessor for the subquery (time) expression from the subquery when the subquery returns a single value.
 
Methods inherited from class org.datanucleus.jdo.query.AbstractTypesafeQuery
compile, discardCompiled, getCompilation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOTypesafeSubquery

public JDOTypesafeSubquery(javax.jdo.PersistenceManager pm,
                           java.lang.Class<T> candidateClass,
                           java.lang.String candidateAlias,
                           JDOTypesafeQuery parentQuery)
Method Detail

getAlias

public java.lang.String getAlias()

candidate

public PersistableExpression candidate()
Description copied from interface: TypesafeSubquery
Method to return an expression for the candidate of the subquery. Cast the returned expression to the candidate "Q" type to be able to call methods on it.

Specified by:
candidate in interface TypesafeSubquery<T>
Returns:
Expression for the candidate

filter

public TypesafeSubquery filter(BooleanExpression expr)
Description copied from interface: TypesafeSubquery
Method to set the filter of the query.

Specified by:
filter in interface TypesafeSubquery<T>
Parameters:
expr - Filter expression
Returns:
The query

groupBy

public TypesafeSubquery groupBy(Expression... exprs)
Description copied from interface: TypesafeSubquery
Method to set the grouping(s) for the query.

Specified by:
groupBy in interface TypesafeSubquery<T>
Parameters:
exprs - Grouping expression(s)
Returns:
The query

having

public TypesafeSubquery having(Expression expr)
Description copied from interface: TypesafeSubquery
Method to set the having clause of the query.

Specified by:
having in interface TypesafeSubquery<T>
Parameters:
expr - Having expression
Returns:
The query

selectUnique

public <S> NumericExpression<S> selectUnique(NumericExpression<S> expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (numeric) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

public StringExpression selectUnique(StringExpression expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (string) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

public <S> DateExpression<S> selectUnique(DateExpression<S> expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (date) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

public <S> DateTimeExpression<S> selectUnique(DateTimeExpression<S> expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (datetime) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

public <S> TimeExpression<S> selectUnique(TimeExpression<S> expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (time) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

public CharacterExpression selectUnique(CharacterExpression expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (character) expression from the subquery when the subquery returns a single value.

Specified by:
selectUnique in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

select

public CollectionExpression select(CollectionExpression expr)
Description copied from interface: TypesafeSubquery
Accessor for the subquery (collection) expression from the subquery.

Specified by:
select in interface TypesafeSubquery<T>
Parameters:
expr - The expression
Returns:
Expression for the typesafe query

internalSelect

protected Expression internalSelect(Expression expr,
                                    java.lang.Class implClass)


Copyright © 2011. All Rights Reserved.