Package io.jmix.data.impl
Interface QueryMacroHandler
- All Known Implementing Classes:
 AbstractQueryMacroHandler,DateAfterMacroHandler,DateBeforeMacroHandler,DateEqualsMacroHandler,EnumQueryMacroHandler,TimeBetweenQueryMacroHandler,TimeTodayQueryMacroHandler
public interface QueryMacroHandler
Interface to be implemented by JPQL macro handlers.
 
The implementation must be a managed bean with "prototype" scope.
- 
Method Summary
Modifier and TypeMethodDescriptionexpandMacro(String queryString) Replaces macro with real JPQL code.replaceQueryParams(String queryString, Map<String, Object> params) Replaces param names inqueryStringwith its values from theparamsparameter.voidsetExpandedParamTypes(Map<String, Class> parameterTypes) Sets expanded parameter types of the expanded query to the macro handler.voidsetQueryParams(Map<String, Object> namedParameters) Sets parameters of the expanded query to the macro handler. 
- 
Method Details
- 
expandMacro
Replaces macro with real JPQL code. If macro is not found, the source query string is returned.- Parameters:
 queryString- source query string- Returns:
 - query string with macros replaced
 
 - 
setQueryParams
Sets parameters of the expanded query to the macro handler.- Parameters:
 namedParameters- all named parameters of the expanded query
 - 
setExpandedParamTypes
Sets expanded parameter types of the expanded query to the macro handler.- Parameters:
 parameterTypes- all expanded parameter types
 - 
getParams
- Returns:
 - all named parameters of the expanded query augmented with the macro parameters
 
 - 
replaceQueryParams
Replaces param names inqueryStringwith its values from theparamsparameter. If macro is not found, the source query string is returned.- Returns:
 - modified query string
 
 
 -