Class ReservedWordAliasValidator

java.lang.Object
io.jmix.aitools.dataload.validation.validator.ReservedWordAliasValidator
All Implemented Interfaces:
JpqlResultValidator, org.springframework.core.Ordered

@Component("aitls_ReservedWordAliasValidator") public class ReservedWordAliasValidator extends Object implements JpqlResultValidator, org.springframework.core.Ordered
Checks that no AS alias in the query uses a reserved word. EclipseLink rejects reserved words used as identification or result variables at parse time, so such an alias fails at execution even though it passes the more lenient parser behind JpqlSyntaxValidator.

The checked words mirror the reserved-word list documented in the aitls_executeQuery tool description; the two must be kept in sync.

  • Field Details

    • RESERVED_ALIAS_CODE

      public static final String RESERVED_ALIAS_CODE
      See Also:
    • RESERVED_ALIAS_GUIDANCE

      public static final String RESERVED_ALIAS_GUIDANCE
      See Also:
    • RESERVED_ALIASES

      protected static final Set<String> RESERVED_ALIASES
      Reserved words that must not be used as aliases. Mirrors the list documented in the aitls_executeQuery tool description.
  • Constructor Details

    • ReservedWordAliasValidator

      public ReservedWordAliasValidator()
  • Method Details

    • validate

      public List<JpqlValidationIssue> validate(GeneratedJpqlResult result)
      Description copied from interface: JpqlResultValidator
      Validates the given query draft.
      Specified by:
      validate in interface JpqlResultValidator
      Parameters:
      result - generated query draft to validate
      Returns:
      issues found, or an empty list if the rule passed
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered