-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config option to disable query validation #3642
base: main
Are you sure you want to change the base?
Conversation
@@ -120,6 +122,8 @@ public JpaRepositoryFactory(EntityManager entityManager) { | |||
} | |||
|
|||
this.crudMethodMetadata = crudMethodMetadataPostProcessor.getCrudMethodMetadata(); | |||
String p = SpringProperties.getProperty("spring.data.jpa.query.validate"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not apply any defaulting from inside our library.
@@ -118,6 +119,7 @@ public void postProcess(BeanDefinitionBuilder builder, RepositoryConfigurationSo | |||
builder.addPropertyValue("transactionManager", transactionManagerRef.orElse(DEFAULT_TRANSACTION_MANAGER_BEAN_NAME)); | |||
builder.addPropertyReference("entityManager", entityManagerRefs.get(source)); | |||
builder.addPropertyValue(ESCAPE_CHARACTER_PROPERTY, getEscapeCharacter(source).orElse('\\')); | |||
getQueryValidation(source).ifPresent(it -> builder.addPropertyValue(QUERY_VALIDATION, it)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need that one since we're not updating @EnableJpaRepositories
QueryRewriter queryRewriter, ValueExpressionDelegate valueExpressionDelegate) { | ||
this(method, em, method.getRequiredAnnotatedQuery(), countQueryString, queryRewriter, valueExpressionDelegate); | ||
QueryRewriter queryRewriter, ValueExpressionDelegate valueExpressionDelegate, boolean validation) { | ||
this(method, em, method.getRequiredAnnotatedQuery(), countQueryString, queryRewriter, valueExpressionDelegate, validation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a QueryValidator
object would make sense instead of a magic boolean. I can handle that during the merge.
Resolves: #1690