Repository update does not work as upsert when using @Where on entity or repository #1243
Labels
status: next major version
The issue will be considered for the next major version
type: improvement
A minor improvement to an existing feature
Milestone
Expected Behavior
When using
@Where
on an entity or a repository, the update method should also create an entity if it does not exist.This behavior exists when using an entity + repository without any
@Where
Annotations, and also worked with@Where
annotations in the micronaut-data version 3.0.1 (micronaut 3.0.2).Actual Behaviour
When using
@Where
either on the entity or the repository, update does not persist an entity if it has not existed before.Here are some tests: https://github.com/flip-corp/micronaut-bugreports-demo/blob/update_does_not_save_anymore/src/test/kotlin/com/example/db/UserRepositoryTest.kt
All of them should pass, but all except the one using a repository and entity without
@Where
fail.Steps To Reproduce
Environment Information
Example Application
https://github.com/flip-corp/micronaut-bugreports-demo/tree/update_does_not_save_anymore
Version
micronaut 3.2.0 and micronaut-data 3.2.1
The text was updated successfully, but these errors were encountered: