public interface ExecutableQuery extends PropertiesCarrier<ExecutableQuery>, DataStoresConditionable<ExecutableQuery>, ContactNodeRestrictions<ExecutableQuery>
PropertiesCarrier
interface: Using any of the PropertiesCarrier
methods on this object cancels all PropertiesCarrier definitions made on the original
query definition.
Methods from the DataStoresConditionable
interface: Using any of the
DataStoresConditionable methods on this object cancels all DataStoresConditionable
definitions made on the original query definition.
Methods from the ContactNodeRestrictions
interface: Using any of the C
ontactNodeRestrictions methods on this object cancels all ContactNodeRestrictions
definitions made on the original query reference definition.
1. Examples of running a parameterized query:
Example 1.1: Running a parameterized query (single value parameter).
This example will set the value of condition matching the parameter name "MyParamName" to the string "MyValue".
The condition is assumed to be capable of handling strings, otherwise an error would occur.
Prerequisites: A query named "MyQuery" with a parameterized property condition named "MyParamName".
How to create a parameterized property condition can be seen in CompletePropertyCondition
.
Example code
ExecutableQuery executableQuery = toplogyQueryService.createExecutableQuery("MyQuery");
executableQuery.queryParameters().addValue("MyParamName", "MyValue");
Topology topology = toplogyQueryService.executeQuery(executableQuery);
//continue using the topology
Example 1.2: Running a parameterized query (range parameter).
This example will set the value of condition matching the parameter name "MyParamName" to the a range of values from 1 to 10.
The condition is assumed to be capable of handling integers, otherwise an error would occur.
Prerequisites: A query named "MyQuery" with a parameterized property condition named "MyParamName".
How to create a parameterized property condition can be seen in CompletePropertyCondition
.
Example code
ExecutableQuery executableQuery = toplogyQueryService.createExecutableQuery("MyQuery");
executableQuery.queryParameters().addValuesInRange("MyParamName", 1, 10);
Topology topology = toplogyQueryService.executeQuery(executableQuery);
//continue using the topology
Example 1.3: Running a parameterized query (Condition replacement).
This example will completely replace the original condition identified by parameter name "MyParamName".
The new condition is assumed to be valid for the query element it's grafted on, otherwise an error would occur.
Prerequisites: A query named "MyQuery" with a parameterized property condition named "MyParamName".
How to create a parameterized property condition can be seen in CompletePropertyCondition
.
Example code
ExecutableQuery executableQuery = toplogyQueryService.createExecutableQuery("MyQuery");
PropertyConditionBuilder builder = executableQuery.queryParameters().createConditionBuilder();
ConditionExpressionBuilder<CompletePropertyCondition, PropertiesConditionOperand> condition =
builder.use(builder.property("Prop1").isEqualTo("Value1"));
executableQuery.queryParameters().addConditionReplacement("MyParamName", condition);
Topology topology = topologyQueryService.executeQuery(executableQuery);
//continue using the topology
Modifier and Type | Method and Description |
---|---|
String |
getDataIntegrityRulesBundle() |
QueryDefinition |
getQueryDefinition() |
PropertiesToQuery |
nodePropertiesToQuery(String nodeName)
Deprecated.
|
QueryNodeRestrictions |
nodeRestrictions(String nodeName)
Returns the existing restrictions the specifed node so they can be
added to and modified.
|
ExecutableQuery |
onTopOfQuery(String parentQueryName)
Sets this query to run over the result of another query.
|
Map<String,PropertiesCarrierWrapper> |
propertiesToQueryPerNode()
Returns the map of node name to properties.
|
PropertiesCarrierWrapper |
propertiesToQueryPerNode(String nodeName)
Returns new or existing properties on a node so they can be added to and modified.
|
QueryParameters |
queryParameters()
Returns the QueryParameters interface.
|
void |
setBooleanParameter(String parameterName,
boolean parameterValue)
Deprecated.
use queryParameters.
|
void |
setBytesParameter(String parameterName,
byte[] parameterValue)
Deprecated.
|
void |
setDateParameter(String parameterName,
Date parameterValue)
Deprecated.
|
void |
setDoubleParameter(String parameterName,
double parameterValue)
Deprecated.
|
void |
setFloatParameter(String parameterName,
float parameterValue)
Deprecated.
use queryParameters.
|
ExecutableQuery |
setForceAdhocCalculationFlag()
Sets this executable query to be calculated without using the query results cache.
|
void |
setIntListParameter(String parameterName,
int[] parameterValue)
Deprecated.
|
void |
setIntListParameter(String parameterName,
Iterable<Integer> parameterValue)
Deprecated.
|
void |
setIntParameter(String parameterName,
int parameterValue)
Deprecated.
|
void |
setLongParameter(String parameterName,
long parameterValue)
Deprecated.
|
void |
setMaxChunkSize(int maxChunkSize)
Sets the limit for maximum elements returned per chunk in the query's result.
|
void |
setParameter(String parameterName,
Object parameterValue)
Deprecated.
use queryParameters.
|
void |
setStringListParameter(String parameterName,
Iterable<String> parameterValue)
Deprecated.
|
void |
setStringListParameter(String parameterName,
String[] parameterValue)
Deprecated.
|
void |
setStringParameter(String parameterName,
String parameterValue)
Deprecated.
|
ExecutableQuery |
withDataIntegrityRulesBundle(String dataIntegrityRulesBundle) |
excludedProperties, excludeProperties, excludeProperty, getDefaultPropertiesToQuery, getPropertiesToQueryPerType, isPropertiesCarrierEmpty, propertiesCarrierBehavior, propertiesToQuery, queryKeyProperties, queryProperties, queryPropertiesWithQualifier, queryProperty, withPropertiesCarrierBehavior
dataStores, isAllDataStores, isInternalDataStoreOnly, withAllDataStores, withDataStores, withDataStores, withInternalDataStoreOnly
queriesRestrictingContactNodes, restrictAllContactNodesByQueries, restrictAllContactNodesByQueries
QueryDefinition getQueryDefinition()
ExecutableQuery onTopOfQuery(String parentQueryName)
QueryDefinition.withBaseQueryName(java.lang.String)
, the parent query result does not
have to be calculated before this can be executed.parentQueryName
- the name of the query that specifies the "universe"
for this query to run onQueryDefinition.withBaseQueryName(java.lang.String)
QueryNodeRestrictions nodeRestrictions(String nodeName)
nodeName
- The node of which to return restrictions.@Deprecated PropertiesToQuery nodePropertiesToQuery(String nodeName)
propertiesToQueryPerNode
PropertiesCarrierWrapper propertiesToQueryPerNode(String nodeName)
Map<String,PropertiesCarrierWrapper> propertiesToQueryPerNode()
propertiesToQueryPerNode(String)
.void setMaxChunkSize(int maxChunkSize)
Topology.getNextChunk()
.ExecutableQuery setForceAdhocCalculationFlag()
@NotFinalAPI QueryParameters queryParameters()
@NotFinalAPI ExecutableQuery withDataIntegrityRulesBundle(String dataIntegrityRulesBundle)
@NotFinalAPI String getDataIntegrityRulesBundle()
@Deprecated void setParameter(String parameterName, Object parameterValue)
@Deprecated void setBooleanParameter(String parameterName, boolean parameterValue)
@Deprecated void setBytesParameter(String parameterName, byte[] parameterValue)
queryParameters()
@Deprecated void setDateParameter(String parameterName, Date parameterValue)
queryParameters()
@Deprecated void setDoubleParameter(String parameterName, double parameterValue)
queryParameters()
@Deprecated void setFloatParameter(String parameterName, float parameterValue)
@Deprecated void setIntListParameter(String parameterName, int[] parameterValue)
queryParameters()
@Deprecated void setIntListParameter(String parameterName, Iterable<Integer> parameterValue)
queryParameters()
@Deprecated void setIntParameter(String parameterName, int parameterValue)
queryParameters()
@Deprecated void setLongParameter(String parameterName, long parameterValue)
queryParameters()
@Deprecated void setStringListParameter(String parameterName, String[] parameterValue)
queryParameters()
@Deprecated void setStringListParameter(String parameterName, Iterable<String> parameterValue)
queryParameters()
@Deprecated void setStringParameter(String parameterName, String parameterValue)
queryParameters()
Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.