public interface TypesafeQuery<T>
Modifier and Type | Field and Description |
---|---|
static String |
QUERY_CLASS_PREFIX |
Modifier and Type | Method and Description |
---|---|
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
|
<T> List<T> |
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.
|
<R> List<R> |
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.
|
<R> R |
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.
|
<T> T |
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.
|
<S> TypesafeSubquery<S> |
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.
|
static final String QUERY_CLASS_PREFIX
PersistableExpression candidate()
Expression parameter(String name, Class type)
name
- Name of the parametertype
- Java type of the parameterStringExpression stringParameter(String name)
name
- Name of the parameterCharacterExpression characterParameter(String name)
name
- Name of the parameterNumericExpression<Long> longParameter(String name)
name
- Name of the parameterNumericExpression<Integer> integerParameter(String name)
name
- Name of the parameterNumericExpression<Short> shortParameter(String name)
name
- Name of the parameterNumericExpression<Double> doubleParameter(String name)
name
- Name of the parameterNumericExpression<Float> floatParameter(String name)
name
- Name of the parameterDateExpression<Date> dateParameter(String name)
name
- Name of the parameterTimeExpression<Time> timeParameter(String name)
name
- Name of the parameterDateTimeExpression<Date> datetimeParameter(String name)
name
- Name of the parameterCollectionExpression collectionParameter(String name)
name
- Name of the parameterMapExpression mapParameter(String name)
name
- Name of the parameterListExpression listParameter(String name)
name
- Name of the parameterExpression variable(String name, Class type)
name
- Name of the variabletype
- Type of the variablejavax.jdo.PersistenceManager getPersistenceManager()
javax.jdo.FetchPlan getFetchPlan()
TypesafeQuery<T> setIgnoreCache(boolean ignore)
ignore
- Ignore the cache flagTypesafeQuery<T> setCandidates(Collection<T> candidates)
candidates
- The candidatesTypesafeQuery<T> excludeSubclasses()
TypesafeQuery<T> includeSubclasses()
TypesafeQuery<T> filter(BooleanExpression expr)
expr
- Filter expressionTypesafeQuery<T> groupBy(Expression... exprs)
exprs
- Grouping expression(s)TypesafeQuery<T> having(Expression expr)
expr
- Having expressionTypesafeQuery<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 candidateTypesafeQuery<T> setParameter(Expression paramExpr, Object value)
paramExpr
- Parameter expressionvalue
- The valueTypesafeQuery<T> setParameter(String paramName, Object value)
paramName
- Parameter namevalue
- The valueTypesafeQuery<T> addExtension(String key, Object value)
key
- the key of the extensionvalue
- the value of the extensionTypesafeQuery<T> setExtensions(Map<String,Object> extensions)
extensions
- the map of extensionsaddExtension(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 expressionObject executeResultUnique(boolean distinct, Expression expr)
distinct
- Whether to provide distinct resultsexpr
- Result expressionList<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()
Copyright © 2023. All rights reserved.