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 PersistenceProvider.getClassTransformer() #650

Open
gavinking opened this issue Aug 30, 2024 · 2 comments · May be fixed by #671
Open

add PersistenceProvider.getClassTransformer() #650

gavinking opened this issue Aug 30, 2024 · 2 comments · May be fixed by #671
Labels
candidate-for-4 Good candidate for JPA 4

Comments

@gavinking
Copy link
Contributor

Currently the Jakarta EE container can only get hold of the ClassTransformer for a persistence provider after the persistence unit has been started. The provider has to call PersistenceUnitInfo.addTransformer(). This is a pretty weird design and results in chicken/egg dependencies for the container.

But we can solve this problem by decoupling the lifecycle here, and adding a method PersistenceProvider.createClassTransformer(PersistenceUnitInfo), allowing enhancement and bootstrap of the persistence unit to occur in two phases.

@gavinking gavinking added the candidate-for-4 Good candidate for JPA 4 label Aug 30, 2024
gavinking added a commit to gavinking/jpa-api that referenced this issue Sep 20, 2024
see issue jakartaee#650

Signed-off-by: Gavin King <gavin@hibernate.org>
@gavinking
Copy link
Contributor Author

gavinking commented Sep 20, 2024

A second thing I would like to do here is to clearly place the responsibility for scanning for entity classes back on the container. I think it's a mistake to place this responsibility on the persistence provider.

This can be easily solved by adding getAllManagedClassNames() to PersistenceUnitInfo.

@gavinking
Copy link
Contributor Author

See the proposal here: https://github.com/jakartaee/persistence/pull/671/files

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

Successfully merging a pull request may close this issue.

1 participant