Skip to content

make it easier to obtain EntityGraphs #693

@gavinking

Description

@gavinking

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions