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

make it easier to obtain EntityGraphs #693

Open
gavinking opened this issue Jan 8, 2025 · 0 comments
Open

make it easier to obtain EntityGraphs #693

gavinking opened this issue Jan 8, 2025 · 0 comments
Labels
candidate-for-4 Good candidate for JPA 4

Comments

@gavinking
Copy link
Contributor

Currently operations for obtaining an EntityGraph are distributed apparently at random between EntityManager and EntityManagerFactory. By rights they belong on EntityManagerFactory, but I suppose people wanted to economize on a call to getEntityManagerFactory() for typical usage patterns. Now EntityAgent is also in the picture.

I have two proposals:

  1. Create a GraphFactory/Registry/Manager interface—or whatever you prefer to call it—as a supertype of EntityManager, EntityAgent, and EntityManagerFactory and pull up all the operations to this supertype.
  2. Add a createGraph() method to EntityType, making it possible to write Book_.class_.createGraph().

Note that these enhancements should be completely trivial to implement for any existing JPA provider.

@gavinking gavinking added the candidate-for-4 Good candidate for JPA 4 label Jan 8, 2025
gavinking added a commit to gavinking/persistence that referenced this issue Jan 9, 2025
gavinking added a commit to gavinking/persistence that referenced this issue Jan 9, 2025
gavinking added a commit to gavinking/persistence that referenced this issue Jan 9, 2025
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

No branches or pull requests

1 participant