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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringReserved words that must not be used as aliases.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()validate(GeneratedJpqlResult result) Validates the given query draft.
-
Field Details
-
RESERVED_ALIAS_CODE
- See Also:
-
RESERVED_ALIAS_GUIDANCE
- See Also:
-
RESERVED_ALIASES
Reserved words that must not be used as aliases. Mirrors the list documented in theaitls_executeQuerytool description.
-
-
Constructor Details
-
ReservedWordAliasValidator
public ReservedWordAliasValidator()
-
-
Method Details
-
validate
Description copied from interface:JpqlResultValidatorValidates the given query draft.- Specified by:
validatein interfaceJpqlResultValidator- Parameters:
result- generated query draft to validate- Returns:
- issues found, or an empty list if the rule passed
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-