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

Support @PersistenceConstructor on entities [DATAJPA-37] #475

Closed
spring-projects-issues opened this issue Mar 17, 2011 · 2 comments
Closed

Support @PersistenceConstructor on entities [DATAJPA-37] #475

spring-projects-issues opened this issue Mar 17, 2011 · 2 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Mar 17, 2011

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 even findOne(…) 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

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 16, 2011

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

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 17, 2019

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant