jpa-spec
  1. jpa-spec
  2. JPA_SPEC-24

Possibility to inject an EntityManager into an Entity

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Hello Group,

      we are currently confronted with the following scenario:
      A legacy database schema has a special table that holds Table-names and associated IDs.
      This table's data differs from one database instance to the other.
      In order to write data to any other table of the database, this table's ID is needed -> look-up in the ID-table.
      To reflect this behavior in a JPA-mapped environment, we wanted each entity to look up its ID in the ID-table before persisting.
      But therefore we'd need a reference to an EntityManager from within an Entity.
      Our solution: make it possible to inject an EntityManager into an Entity.

      Best Regards,

      Andreas Bauer

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            AndreasBauer
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: