Support @PersistenceConstructor on entities [DATAJPA-37] #475
Milestone
Comments
Oliver Drotbohm commented I think this has to be on hold for now as the JPA spec currently defines the entities returned by queries using a constructor expression to be in either new or detached state but not in managed. So the entity lifecycle state would differ from the one being loaded without a constructor argument (managed). See section 4.8.2 of the JPA sepcification |
Jens Schauder commented Closing this, since it is currently not possible to implement in a reasonable way as laid out by Oliver. If the JPA Specification changes and gets implemented anybody is free to reopen this issue or create a new one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oliver Drotbohm opened DATAJPA-37 and commented
In Spring Data Commons we have a
@PersistenceConstructor
annotation that demarcates the constructor to be used when instantiating objects. It would be cool if the query methods and maybe evenfindOne(…)
being able to detect that annotation and force the persistence provider to use that constructor (probably by using the Criteria API)No further details from DATAJPA-37
The text was updated successfully, but these errors were encountered: