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

Using @Where on entity or repository does not work with overriden repository methods #1237

Closed
nfode opened this issue Dec 7, 2021 · 0 comments · Fixed by #1238
Closed

Using @Where on entity or repository does not work with overriden repository methods #1237

nfode opened this issue Dec 7, 2021 · 0 comments · Fixed by #1238
Labels
type: bug Something isn't working
Milestone

Comments

@nfode
Copy link

nfode commented Dec 7, 2021

Expected Behavior

When using @Where on an entity or a repository, the @Where clause should be appended to the query generated by a repository method that overrides the base methods.

Example for a method overriding the built-in findById-Method:

@Repository
@Where("deleted = false")
interface UserRepositoryMicronautWhereOnRepository : ReactiveStreamsCrudRepository<UserWhereOnRepo, UUID> {
    override fun findById(id: UUID): Mono<UserWhereOnRepo>
}

Actual Behaviour

When overriding a repository method like in the exampel above, the @Where clause is not appended to the query generated by the findById-Method. That worked with micronaut-data 3.0.2.

Steps To Reproduce

  1. Clone the example repository here: https://github.com/flip-corp/micronaut-bugreports-demo/tree/override_with_where_on_repo_does_not_work
  2. Run the tests. There is a Test for @Where on the entity and on the repository.

Environment Information

  • JDK 17

Example Application

https://github.com/flip-corp/micronaut-bugreports-demo/tree/override_with_where_on_repo_does_not_work

Version

micronaut 3.2.0 and micronaut-data 3.2.1

@dstepanov dstepanov added the type: bug Something isn't working label Dec 20, 2021
@dstepanov dstepanov added this to the 3.2.2 milestone Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants