|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TypesafeQuery<T>
Interface for a type-safe query, using a fluent API. Designed to handle JDO query requirements as a whole.
| Field Summary | |
|---|---|
static String |
QUERY_CLASS_PREFIX
|
| Method Summary | ||
|---|---|---|
TypesafeQuery<T> |
addExtension(String key,
Object value)
Add a vendor-specific extension to this query. |
|
PersistableExpression |
candidate()
Method to return an expression for the candidate of the query. |
|
CharacterExpression |
characterParameter(String name)
Method to return a character parameter for the query. |
|
void |
close(Object result)
Method to close the specified query result. |
|
void |
closeAll()
Method to close all query results from this query. |
|
CollectionExpression |
collectionParameter(String name)
Method to return a collection parameter for the query. |
|
DateExpression<Date> |
dateParameter(String name)
Method to return a date parameter for the query. |
|
DateTimeExpression<Date> |
datetimeParameter(String name)
Method to return a datetime parameter for the query. |
|
long |
deletePersistentAll()
Method to execute the query deleting the affected instances. |
|
NumericExpression<Double> |
doubleParameter(String name)
Method to return a numeric parameter for the query. |
|
TypesafeQuery<T> |
excludeSubclasses()
Method to remove subclasses (of the candidate) from the query |
|
|
executeList()
Method to execute the query where there are (potentially) multiple rows and we are returning the candidate type. |
|
List<Object[]> |
executeResultList(boolean distinct,
Expression... exprs)
Method to execute the query where there are (potentially) multiple rows and we have a result defined but no result class. |
|
List<Object> |
executeResultList(boolean distinct,
Expression expr)
Method to execute the query where there are (potentially) multiple rows and we have a single result defined but no result class. |
|
|
executeResultList(Class<R> resultCls,
boolean distinct,
Expression... exprs)
Method to execute the query where there are (potentially) multiple rows and we are returning either a result type or the candidate type. |
|
Object[] |
executeResultUnique(boolean distinct,
Expression... exprs)
Method to execute the query where there is a single row and we have a result defined but no result class. |
|
Object |
executeResultUnique(boolean distinct,
Expression expr)
Method to execute the query where there is a single row and we have a single result defined but no result class. |
|
|
executeResultUnique(Class<R> resultCls,
boolean distinct,
Expression... exprs)
Method to execute the query where there is a single row and we are returning either a result type or the candidate type. |
|
|
executeUnique()
Method to execute the query where there is a single row and we are returning the candidate type. |
|
TypesafeQuery<T> |
filter(BooleanExpression expr)
Method to set the filter of the query. |
|
NumericExpression<Float> |
floatParameter(String name)
Method to return a numeric parameter for the query. |
|
javax.jdo.FetchPlan |
getFetchPlan()
Accessor for the FetchPlan for this query |
|
javax.jdo.PersistenceManager |
getPersistenceManager()
Accessor for the PersistenceManager for this query |
|
TypesafeQuery<T> |
groupBy(Expression... exprs)
Method to set the grouping(s) for the query. |
|
TypesafeQuery<T> |
having(Expression expr)
Method to set the having clause of the query. |
|
TypesafeQuery<T> |
includeSubclasses()
Method to include subclasses (of the candidate) to the query |
|
NumericExpression<Integer> |
integerParameter(String name)
Method to return a numeric parameter for the query. |
|
ListExpression |
listParameter(String name)
Method to return a list parameter for the query. |
|
NumericExpression<Long> |
longParameter(String name)
Method to return a numeric parameter for the query. |
|
MapExpression |
mapParameter(String name)
Method to return a map parameter for the query. |
|
TypesafeQuery<T> |
orderBy(OrderExpression... orderExprs)
Method to set the ordering of the query. |
|
Expression |
parameter(String name,
Class type)
Method to return a parameter for the query. |
|
TypesafeQuery<T> |
range(Expression paramLowerInclExpr,
Expression paramUpperExclExpr)
Method to set the range of any required results, using parameters (expressions). |
|
TypesafeQuery<T> |
range(long lowerIncl,
long upperExcl)
Method to set the range of any required results, using long values. |
|
TypesafeQuery<T> |
range(NumericExpression lowerInclExpr,
NumericExpression upperExclExpr)
Method to set the range of any required results, using expressions. |
|
TypesafeQuery<T> |
setCandidates(Collection<T> candidates)
Method to set the candidates to use over which we are querying. |
|
TypesafeQuery<T> |
setExtensions(Map<String,Object> extensions)
Set multiple extensions, or use null to clear all extensions. |
|
TypesafeQuery<T> |
setIgnoreCache(boolean ignore)
Whether the query should ignore the cache and go straight to the datastore. |
|
TypesafeQuery<T> |
setParameter(Expression paramExpr,
Object value)
Method to set a parameter value for use when executing the query. |
|
TypesafeQuery<T> |
setParameter(String paramName,
Object value)
Method to set a parameter value for use when executing the query. |
|
NumericExpression<Short> |
shortParameter(String name)
Method to return a numeric parameter for the query. |
|
StringExpression |
stringParameter(String name)
Method to return a string parameter for the query. |
|
|
subquery(Class<S> candidate,
String candidateAlias)
Method to return a subquery for use in this query. |
|
TypesafeSubquery<T> |
subquery(String candidateAlias)
Method to return a subquery for use in this query using the same candidate class as this query. |
|
TimeExpression<Time> |
timeParameter(String name)
Method to return a time parameter for the query. |
|
String |
toString()
Method to return the equivalent String form of this query (if applicable for the query language). |
|
Expression |
variable(String name,
Class type)
Method to return a variable for this query. |
|
| Field Detail |
|---|
static final String QUERY_CLASS_PREFIX
| Method Detail |
|---|
PersistableExpression candidate()
Expression parameter(String name,
Class type)
name - Name of the parametertype - Java type of the parameter
StringExpression stringParameter(String name)
name - Name of the parameter
CharacterExpression characterParameter(String name)
name - Name of the parameter
NumericExpression<Long> longParameter(String name)
name - Name of the parameter
NumericExpression<Integer> integerParameter(String name)
name - Name of the parameter
NumericExpression<Short> shortParameter(String name)
name - Name of the parameter
NumericExpression<Double> doubleParameter(String name)
name - Name of the parameter
NumericExpression<Float> floatParameter(String name)
name - Name of the parameter
DateExpression<Date> dateParameter(String name)
name - Name of the parameter
TimeExpression<Time> timeParameter(String name)
name - Name of the parameter
DateTimeExpression<Date> datetimeParameter(String name)
name - Name of the parameter
CollectionExpression collectionParameter(String name)
name - Name of the parameter
MapExpression mapParameter(String name)
name - Name of the parameter
ListExpression listParameter(String name)
name - Name of the parameter
Expression variable(String name,
Class type)
name - Name of the variabletype - Type of the variable
javax.jdo.PersistenceManager getPersistenceManager()
javax.jdo.FetchPlan getFetchPlan()
TypesafeQuery<T> setIgnoreCache(boolean ignore)
ignore - Ignore the cache flag
TypesafeQuery<T> setCandidates(Collection<T> candidates)
candidates - The candidates
TypesafeQuery<T> excludeSubclasses()
TypesafeQuery<T> includeSubclasses()
TypesafeQuery<T> filter(BooleanExpression expr)
expr - Filter expression
TypesafeQuery<T> groupBy(Expression... exprs)
exprs - Grouping expression(s)
TypesafeQuery<T> having(Expression expr)
expr - Having expression
TypesafeQuery<T> orderBy(OrderExpression... orderExprs)
orderExprs - Ordering expression(s)
TypesafeQuery<T> range(NumericExpression lowerInclExpr,
NumericExpression upperExclExpr)
lowerInclExpr - The position of the first result (inclusive)upperExclExpr - The position of the last result (exclusive)
TypesafeQuery<T> range(long lowerIncl,
long upperExcl)
lowerIncl - The position of the first result (inclusive)upperExcl - The position of the last result (exclusive)
TypesafeQuery<T> range(Expression paramLowerInclExpr,
Expression paramUpperExclExpr)
paramLowerInclExpr - Expression for a parameter defining the position of the first result (inclusive)paramUpperExclExpr - Expression for a parameter defining the position of the last result (exclusive)
TypesafeSubquery<T> subquery(String candidateAlias)
candidateAlias - Alias for the candidate
<S> TypesafeSubquery<S> subquery(Class<S> candidate,
String candidateAlias)
candidate - Candidate for the subquerycandidateAlias - Alias for the candidate
TypesafeQuery<T> setParameter(Expression paramExpr,
Object value)
paramExpr - Parameter expressionvalue - The value
TypesafeQuery<T> setParameter(String paramName,
Object value)
paramName - Parameter namevalue - The value
TypesafeQuery<T> addExtension(String key,
Object value)
key - the key of the extensionvalue - the value of the extension
TypesafeQuery<T> setExtensions(Map<String,Object> extensions)
extensions - the map of extensions
addExtension(java.lang.String, java.lang.Object)<T> List<T> executeList()
<T> T executeUnique()
<R> List<R> executeResultList(Class<R> resultCls,
boolean distinct,
Expression... exprs)
resultCls - Result classdistinct - Whether to provide distinct resultsexprs - Result expression(s)
<R> R executeResultUnique(Class<R> resultCls,
boolean distinct,
Expression... exprs)
resultCls - Result classdistinct - Whether to provide distinct resultsexprs - Result expression(s)
List<Object> executeResultList(boolean distinct,
Expression expr)
distinct - Whether to provide distinct resultsexpr - Result expression
Object executeResultUnique(boolean distinct,
Expression expr)
distinct - Whether to provide distinct resultsexpr - Result expression
List<Object[]> executeResultList(boolean distinct,
Expression... exprs)
distinct - Whether to provide distinct resultsexprs - Result expression(s)
Object[] executeResultUnique(boolean distinct,
Expression... exprs)
distinct - Whether to provide distinct resultsexprs - Result expression(s)
long deletePersistentAll()
void close(Object result)
result - The resultvoid closeAll()
String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||