Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1233

Persistence injection could support casting to OpenJPA types

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • connectors
    • Any

    Description

      As given in the EJB 3 specification, if a PersistenceContext annotation is used on a EntityManager field, or a PersistenceUnit is used on a EntityManagerFactory field, OpenEJB injects the appropriate object. However, developers may want to want to leverage the additional methods provided by OpenJPA. Currently, if the annotated types are OpenJPAEntityManager or OpenJPAEntityManagerFactory, OpenEJB leaves the fields as null. To obtain OpenJPA types, developers must call the OpenJPAPersistence.cast() method, generally in a PostContruct annotated method. OpenEJB could detect that the annotated types are of OpenJPA and perform appropriate casting and injection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            brainchild Eric Levy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: