Interface ConfigService
- All Known Implementing Classes:
StandardConfigService
Iterated objects from Mastered objects (or a QuerySpec) and a ConfigSpec.
- Cookie: None
- Helper:
ConfigHelperwith several helper methods - Service implementation:
StandardConfigServicewith no listeners - ServiceEvent: None
- ServiceException:
ConfigException
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescription<T extends ConfigSpec>
QueryResultfilteredIterationsOf(QueryResult masters, List<T> configSpecs) Returns aQueryResultofIteratedobjects that are related to the givenQueryResultofMasteredobjects and are valid for the givenConfigSpecs.filteredIterationsOf(QueryResult masters, ConfigSpec configSpec) Returns aQueryResultofIteratedobjects that are related to the givenQueryResultofMasteredobjects and are valid for the givenConfigSpec.<T extends ConfigSpec>
QueryResultfilteredIterationsOf(Mastered master, List<T> configSpecs) Returns aQueryResultofIteratedobjects that are related to the givenMasteredobject and are valid for the givenConfigSpecs.filteredIterationsOf(Mastered master, ConfigSpec configSpec) Returns aQueryResultofIteratedobjects that are related to the givenMasteredobject and are valid for the givenConfigSpec.getConfigSpecFor(NavCriteriaContext context) Lookup theGetConfigSpecForDelegate2delegate and use its methods to get a list of ConfigSpecs.queryIterations(QuerySpec querySpec, ConfigSpec configSpec) Returns aQueryResultofIteratedobjects that have been selected by the givenQuerySpecand are valid for the givenConfigSpec.queryIterations(QuerySpec querySpec, ConfigSpec configSpec, QueryIterationsCallback callback) A variant of thequeryIterations(QuerySpec, ConfigSpec)API that allows for an (optional) callback API which, when called, is passed the appropriateQuerySpec-- the sub-select when using in-database config spec processing, and the outer-select when it is not being used -- to allow for additional criteria to be supplied.
-
Method Details
-
filteredIterationsOf
QueryResult filteredIterationsOf(Mastered master, ConfigSpec configSpec) throws WTException, PersistenceException Returns aQueryResultofIteratedobjects that are related to the givenMasteredobject and are valid for the givenConfigSpec.
Supported API: true- Parameters:
master- The master to get the iterations for.configSpec- The ConfigSpec to process this master's iterations against.- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException
-
filteredIterationsOf
QueryResult filteredIterationsOf(QueryResult masters, ConfigSpec configSpec) throws WTException, PersistenceException Returns aQueryResultofIteratedobjects that are related to the givenQueryResultofMasteredobjects and are valid for the givenConfigSpec.
Supported API: true- Parameters:
masters- The QueryResult of masters to get the iterations for.configSpec- The ConfigSpec to process the resulting iterations against.- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException
-
filteredIterationsOf
<T extends ConfigSpec> QueryResult filteredIterationsOf(Mastered master, List<T> configSpecs) throws WTException, PersistenceException Returns aQueryResultofIteratedobjects that are related to the givenMasteredobject and are valid for the givenConfigSpecs.
Supported API: true- Type Parameters:
T- a sub-type of ConfigSpec- Parameters:
master- The master to get the iterations for.configSpecs- The ConfigSpecs to process this master's iterations against.- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException
-
filteredIterationsOf
<T extends ConfigSpec> QueryResult filteredIterationsOf(QueryResult masters, List<T> configSpecs) throws WTException, PersistenceException Returns aQueryResultofIteratedobjects that are related to the givenQueryResultofMasteredobjects and are valid for the givenConfigSpecs.
Supported API: true- Type Parameters:
T- a sub-type of ConfigSpec- Parameters:
masters- The QueryResult of masters to get the iterations for.configSpecs- The ConfigSpecs to process the resulting iterations against.- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException
-
queryIterations
QueryResult queryIterations(QuerySpec querySpec, ConfigSpec configSpec) throws WTException, PersistenceException Returns aQueryResultofIteratedobjects that have been selected by the givenQuerySpecand are valid for the givenConfigSpec. This API disables in-database config spec processing unless thewt.vc.config.relationalizeQueryIterationsproperty is set to "true" inwt.propertiesbecause the in-database config spec queries perform well only when the selection logic is in the sub-select statement created to facilitate the query, and this API doesn't allow the sub-select statement to be manipulated, forcing the logic in the outer-select statement.With in-database config spec processing disabled, this API appends the
querySpecwith logic specified byConfigSpec.appendSearchCriteria(QuerySpec), queries the data- base with the altered config spec, and then post-processes the result usingConfigSpec.process(QueryResult).Supported API: true
- Parameters:
querySpec- The QuerySpec with an iterated primary classconfigSpec- The ConfigSpec to filter iterations against- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException- See Also:
-
queryIterations
QueryResult queryIterations(QuerySpec querySpec, ConfigSpec configSpec, QueryIterationsCallback callback) throws WTException, PersistenceException A variant of thequeryIterations(QuerySpec, ConfigSpec)API that allows for an (optional) callback API which, when called, is passed the appropriateQuerySpec-- the sub-select when using in-database config spec processing, and the outer-select when it is not being used -- to allow for additional criteria to be supplied. In-database config spec processing is always used when thecallbackis non-null and theconfigSpecsupports it.The purpose of the callback is to ensure that the "additional criteria" gets applied to the proper select (sub- or outer-select) statement, a key consideration when using in-database config spec processing. Note that the callback need not concern itself with whether in-database config spec processing is actually being utilized or not. Using this API is preferred over
queryIterations(QuerySpec, ConfigSpec), as in-database config spec processing outperforms a "regular" query with post-processing. The following code illustrates proper use (if querying for the "latest" versions of part(s) named "foo"):QueryResult qr = ConfigHelper.service.queryIterations(new QuerySpec(WTPart.class), new LatestConfigSpec(), new QueryIterationsCallback() { public void appendTo(final QuerySpec qs) throws WTException { qs.appendAnd(); qs.appendWhere(new SearchCondition(WTPart.class, WTPart.NAME, SearchCondition.EQUAL, "foo")); } });As with
ConfigSpec.appendSearchCriteria(QuerySpec), the passed-inQuerySpecdoes not presumptively pass in an "and" condition, making the the responsibility of the callback to handle this.Supported API: true
- Parameters:
querySpec- The QuerySpec with an Iterated primary classconfigSpec- The ConfigSpec to filter iterations againstcallback- The code needed to append to the QuerySpec (see above)- Returns:
- QueryResult
- Throws:
WTExceptionPersistenceException
-