Package org.ehrbase.openehr.aqlengine
Class AqlParameterPostProcessor
java.lang.Object
org.ehrbase.openehr.aqlengine.AqlParameterPostProcessor
- All Implemented Interfaces:
AqlQueryParsingPostProcessor,org.springframework.core.Ordered
@Component
public class AqlParameterPostProcessor
extends Object
implements AqlQueryParsingPostProcessor
Replaces parameters in an AQL query
-
Field Summary
Fields inherited from interface org.ehrbase.openehr.aqlengine.AqlQueryParsingPostProcessor
EHR_PATH_PRECEDENCE, FEATURE_CHECK_PRECEDENCE, FROM_EHR_OPTIMISATION_PRECEDENCE, LIMIT_CONSTRAINT_PRECEDENCE, PARAMETER_REPLACEMENT_PRECEDENCEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterParseAql(org.ehrbase.openehr.sdk.aql.dto.AqlQuery aqlQuery, AqlQueryRequest request, AqlQueryContext ctx) Invoked after parsing the raw AQL string.intgetOrder()static voidreplaceIdentifiedPathParameters(org.ehrbase.openehr.sdk.aql.dto.operand.IdentifiedPath identifiedPath, Map<String, Object> parameterMap) static voidreplaceParameters(org.ehrbase.openehr.sdk.aql.dto.AqlQuery aqlQuery, Map<String, Object> parameterMap) Replaces all parameters in theaqlQuerywith values from theparameterMap.
-
Constructor Details
-
AqlParameterPostProcessor
public AqlParameterPostProcessor()
-
-
Method Details
-
afterParseAql
public void afterParseAql(org.ehrbase.openehr.sdk.aql.dto.AqlQuery aqlQuery, AqlQueryRequest request, AqlQueryContext ctx) Description copied from interface:AqlQueryParsingPostProcessorInvoked after parsing the raw AQL string. The givenAqlQueryobject can be modified in-place. Meta information can be added through theAqlQueryContext.- Specified by:
afterParseAqlin interfaceAqlQueryParsingPostProcessor- Parameters:
aqlQuery- object representing the parsed AQL stringrequest- the request passed to the service layerctx- the query context
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
replaceParameters
public static void replaceParameters(org.ehrbase.openehr.sdk.aql.dto.AqlQuery aqlQuery, Map<String, Object> parameterMap) Replaces all parameters in theaqlQuerywith values from theparameterMap. The replacement is performed in-place, modifying the source object. Missing parameter values are set to NULL.- Parameters:
aqlQuery- the query to me modifiedparameterMap- a map of parameter values
-
replaceIdentifiedPathParameters
-