|
||||||||||
| 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 java.lang.String |
QUERY_CLASS_PREFIX
|
| Method Summary | ||
|---|---|---|
TypesafeQuery<T> |
addExtension(java.lang.String key,
java.lang.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(java.lang.String name)
Method to return a character parameter for the query. |
|
void |
close(java.lang.Object result)
Method to close the specified query result. |
|
void |
closeAll()
Method to close all query results from this query. |
|
CollectionExpression |
collectionParameter(java.lang.String name)
Method to return a collection parameter for the query. |
|
DateExpression<java.sql.Date> |
dateParameter(java.lang.String name)
Method to return a date parameter for the query. |
|
DateTimeExpression<java.util.Date> |
datetimeParameter(java.lang.String name)
Method to return a datetime parameter for the query. |
|
long |
deletePersistentAll()
Method to execute the query deleting the affected instances. |
|
NumericExpression<java.lang.Double> |
doubleParameter(java.lang.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. |
|
java.util.List<java.lang.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. |
|
|
executeResultList(java.lang.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. |
|
java.lang.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. |
|
|
executeResultUnique(java.lang.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<java.lang.Float> |
floatParameter(java.lang.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<java.lang.Integer> |
integerParameter(java.lang.String name)
Method to return a numeric parameter for the query. |
|
ListExpression |
listParameter(java.lang.String name)
Method to return a list parameter for the query. |
|
NumericExpression<java.lang.Long> |
longParameter(java.lang.String name)
Method to return a numeric parameter for the query. |
|
MapExpression |
mapParameter(java.lang.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(java.lang.String name,
java.lang.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(java.util.Collection<T> candidates)
Method to set the candidates to use over which we are querying. |
|
TypesafeQuery<T> |
setExtensions(java.util.Map<java.lang.String,java.lang.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,
java.lang.Object value)
Method to set a parameter value for use when executing the query. |
|
TypesafeQuery<T> |
setParameter(java.lang.String paramName,
java.lang.Object value)
Method to set a parameter value for use when executing the query. |
|
NumericExpression<java.lang.Short> |
shortParameter(java.lang.String name)
Method to return a numeric parameter for the query. |
|
StringExpression |
stringParameter(java.lang.String name)
Method to return a string parameter for the query. |
|
|
subquery(java.lang.Class<S> candidate,
java.lang.String candidateAlias)
Method to return a subquery for use in this query. |
|
TypesafeSubquery<T> |
subquery(java.lang.String candidateAlias)
Method to return a subquery for use in this query using the same candidate class as this query. |
|
TimeExpression<java.sql.Time> |
timeParameter(java.lang.String name)
Method to return a time parameter for the query. |
|
java.lang.String |
toString()
Method to return the equivalent String form of this query (if applicable for the query language). |
|
Expression |
variable(java.lang.String name,
java.lang.Class type)
Method to return a variable for this query. |
|
| Field Detail |
|---|
static final java.lang.String QUERY_CLASS_PREFIX
| Method Detail |
|---|
PersistableExpression candidate()
Expression parameter(java.lang.String name,
java.lang.Class type)
name - Name of the parametertype - Java type of the parameter
StringExpression stringParameter(java.lang.String name)
name - Name of the parameter
CharacterExpression characterParameter(java.lang.String name)
name - Name of the parameter
NumericExpression<java.lang.Long> longParameter(java.lang.String name)
name - Name of the parameter
NumericExpression<java.lang.Integer> integerParameter(java.lang.String name)
name - Name of the parameter
NumericExpression<java.lang.Short> shortParameter(java.lang.String name)
name - Name of the parameter
NumericExpression<java.lang.Double> doubleParameter(java.lang.String name)
name - Name of the parameter
NumericExpression<java.lang.Float> floatParameter(java.lang.String name)
name - Name of the parameter
DateExpression<java.sql.Date> dateParameter(java.lang.String name)
name - Name of the parameter
TimeExpression<java.sql.Time> timeParameter(java.lang.String name)
name - Name of the parameter
DateTimeExpression<java.util.Date> datetimeParameter(java.lang.String name)
name - Name of the parameter
CollectionExpression collectionParameter(java.lang.String name)
name - Name of the parameter
MapExpression mapParameter(java.lang.String name)
name - Name of the parameter
ListExpression listParameter(java.lang.String name)
name - Name of the parameter
Expression variable(java.lang.String name,
java.lang.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(java.util.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(java.lang.String candidateAlias)
candidateAlias - Alias for the candidate
<S> TypesafeSubquery<S> subquery(java.lang.Class<S> candidate,
java.lang.String candidateAlias)
candidate - Candidate for the subquerycandidateAlias - Alias for the candidate
TypesafeQuery<T> setParameter(Expression paramExpr,
java.lang.Object value)
paramExpr - Parameter expressionvalue - The value
TypesafeQuery<T> setParameter(java.lang.String paramName,
java.lang.Object value)
paramName - Parameter namevalue - The value
TypesafeQuery<T> addExtension(java.lang.String key,
java.lang.Object value)
key - the key of the extensionvalue - the value of the extension
TypesafeQuery<T> setExtensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
extensions - the map of extensions
addExtension(java.lang.String, java.lang.Object)<T> java.util.List<T> executeList()
<T> T executeUnique()
<R> java.util.List<R> executeResultList(java.lang.Class<R> resultCls,
boolean distinct,
Expression... exprs)
resultCls - Result classdistinct - Whether to provide distinct resultsexprs - Result expression(s)
<R> R executeResultUnique(java.lang.Class<R> resultCls,
boolean distinct,
Expression... exprs)
resultCls - Result classdistinct - Whether to provide distinct resultsexprs - Result expression(s)
java.util.List<java.lang.Object[]> executeResultList(boolean distinct,
Expression... exprs)
distinct - Whether to provide distinct resultsexprs - Result expression(s)
java.lang.Object[] executeResultUnique(boolean distinct,
Expression... exprs)
distinct - Whether to provide distinct resultsexprs - Result expression(s)
long deletePersistentAll()
void close(java.lang.Object result)
result - The resultvoid closeAll()
java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||