Class AbstractQueryMacroHandler

java.lang.Object
io.jmix.data.impl.querymacro.AbstractQueryMacroHandler
All Implemented Interfaces:
QueryMacroHandler
Direct Known Subclasses:
DateAfterMacroHandler, DateBeforeMacroHandler, DateEqualsMacroHandler, EnumQueryMacroHandler, TimeBetweenQueryMacroHandler, TimeTodayQueryMacroHandler

public abstract class AbstractQueryMacroHandler extends Object implements QueryMacroHandler
  • Field Details

    • count

      protected int count
    • macroPattern

      protected final Pattern macroPattern
    • expandedParamTypes

      protected Map<String,Class> expandedParamTypes
    • currentAuthentication

      protected CurrentAuthentication currentAuthentication
  • Constructor Details

    • AbstractQueryMacroHandler

      protected AbstractQueryMacroHandler(Pattern macroPattern)
  • Method Details

    • setCurrentAuthentication

      @Autowired public void setCurrentAuthentication(CurrentAuthentication currentAuthentication)
    • expandMacro

      public String expandMacro(String queryString)
      Description copied from interface: QueryMacroHandler
      Replaces macro with real JPQL code. If macro is not found, the source query string is returned.
      Specified by:
      expandMacro in interface QueryMacroHandler
      Parameters:
      queryString - source query string
      Returns:
      query string with macros replaced
    • doExpand

      protected abstract String doExpand(String macro)
    • setExpandedParamTypes

      public void setExpandedParamTypes(Map<String,Class> expandedParamTypes)
      Description copied from interface: QueryMacroHandler
      Sets expanded parameter types of the expanded query to the macro handler.
      Specified by:
      setExpandedParamTypes in interface QueryMacroHandler
      Parameters:
      expandedParamTypes - all expanded parameter types
    • getTimeZoneFromArgs

      @Nullable protected TimeZone getTimeZoneFromArgs(String[] args, int pos)