org.datanucleus.query.typesafe
Interface TypesafeSubquery<T>

All Known Implementing Classes:
JDOTypesafeSubquery

public interface TypesafeSubquery<T>

Interface for a type-safe subquery, using a fluent API. Users should call methods on the subquery instance and end with a select of what the subquery returns; this returns the expression that they use to link it with the owning query. (Candidate) type being represented


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.
 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.
 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.
 

Method Detail

candidate

PersistableExpression candidate()
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.

Returns:
Expression for the candidate

filter

TypesafeSubquery filter(BooleanExpression expr)
Method to set the filter of the query.

Parameters:
expr - Filter expression
Returns:
The query

groupBy

TypesafeSubquery groupBy(Expression... exprs)
Method to set the grouping(s) for the query.

Parameters:
exprs - Grouping expression(s)
Returns:
The query

having

TypesafeSubquery having(Expression expr)
Method to set the having clause of the query.

Parameters:
expr - Having expression
Returns:
The query

selectUnique

<S> NumericExpression<S> selectUnique(NumericExpression<S> expr)
Accessor for the subquery (numeric) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

StringExpression selectUnique(StringExpression expr)
Accessor for the subquery (string) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

<S> DateExpression<S> selectUnique(DateExpression<S> expr)
Accessor for the subquery (date) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

<S> DateTimeExpression<S> selectUnique(DateTimeExpression<S> expr)
Accessor for the subquery (datetime) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

<S> TimeExpression<S> selectUnique(TimeExpression<S> expr)
Accessor for the subquery (time) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

selectUnique

CharacterExpression selectUnique(CharacterExpression expr)
Accessor for the subquery (character) expression from the subquery when the subquery returns a single value.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query

select

CollectionExpression select(CollectionExpression expr)
Accessor for the subquery (collection) expression from the subquery.

Parameters:
expr - The expression
Returns:
Expression for the typesafe query


Copyright © 2011. All Rights Reserved.