Class ReadOnlyQueryValidator
java.lang.Object
io.jmix.aitools.dataload.validation.validator.ReadOnlyQueryValidator
- All Implemented Interfaces:
JpqlResultValidator,org.springframework.core.Ordered
@Component("aitls_ReadOnlyQueryJpqlValidator")
public class ReadOnlyQueryValidator
extends Object
implements JpqlResultValidator, org.springframework.core.Ordered
Checks that the query is a read-only select, rejecting non-select queries and write operations
(update, delete, insert), as well as the native escape functions
SQL(...) and
FUNCTION(...) that can run raw SQL or native database functions and so bypass the
read-only guarantee.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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
-
JPQL_NOT_SELECT_CODE
- See Also:
-
JPQL_NOT_SELECT_GUIDANCE
- See Also:
-
JPQL_WRITE_OPERATION_CODE
- See Also:
-
JPQL_WRITE_OPERATION_GUIDANCE
- See Also:
-
JPQL_NATIVE_FUNCTION_CODE
- See Also:
-
JPQL_NATIVE_FUNCTION_GUIDANCE
- See Also:
-
-
Constructor Details
-
ReadOnlyQueryValidator
public ReadOnlyQueryValidator()
-
-
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
-