Skip to content
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 spring data jpa @Query support #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

destan
Copy link

@destan destan commented Sep 4, 2019

  • 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.

@gavinking
Copy link
Member

Thanks, I'll review it properly soon, I promise!

@gavinking
Copy link
Member

@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.

@destan
Copy link
Author

destan commented Jan 16, 2020

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?

@gavinking
Copy link
Member

spring dependencies are only required for tests

Sure, but I would prefer that this project didn't have a dependency to Spring.

@gavinking
Copy link
Member

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.

@destan
Copy link
Author

destan commented Jan 20, 2020

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.

@gavinking
Copy link
Member

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants