query-validator
query-validator copied to clipboard
add spring data jpa @Query support
- Adds support for queries in
@Query
annotation of Spring Data JPA. - Ignores the query when
nativeQuery = true
on the annotation - does not support (not check)
countQuery
on the annotation yet.
tried to follow the repository's coding style and conventions as much as I can but I can fix things if you point them on comments.
Thanks, I'll review it properly soon, I promise!
@destan do you think there's a way we could do this without adding a hard dependency to Spring?
I mean, in principle it's enough just to know the name of the annotation.
spring dependencies are only required for tests, there is no hard spring dependency for the query-validator
itself.
Normally spring dependencies should be test scoped build.gradle
dependency entries however due to the implementation of the tests I had to put them into the lib
folder.
is there anything I overlooked?
spring dependencies are only required for tests
Sure, but I would prefer that this project didn't have a dependency to Spring.
By the way, if you're worried about it breaking in tests, you could just add an annotation with the same name as the Spring @Query
annotation to the test module.
you could just add an annotation with the same name as the Spring @Query annotation to the test module
I didn't think of that in the first place, let me update the PR according to this approach and make it free of any spring dependencies.
Great, thanks!