MyFaces CODI
  1. MyFaces CODI
  2. EXTCDI-254

support entity-manager injected via @PersistenceContext

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.3
    • Component/s: JEE-JPA1-Module
    • Labels:
      None

      Description

      it should

      //...
      public class MyBean
      {
      @PersistenceContext(unitName = "myPersistenceUnit")
      private EntityManager entityManager;

      @Transactional
      public void delete(Entity entity)

      { this.entityManager.remove(em.merge(entity)); }

      @PreDestroy
      public void cleanup()
      {
      if(this.entityManager.isOpen())

      { this.entityManager.close(); }

      }
      }

        Issue Links

          Activity

          Gerhard Petracek created issue -
          Gerhard Petracek made changes -
          Field Original Value New Value
          Link This issue incorporates EXTCDI-253 [ EXTCDI-253 ]
          Gerhard Petracek made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.0.3 [ 12319170 ]
          Resolution Fixed [ 1 ]
          Gerhard Petracek made changes -
          Summary support entity-manager injected by @PersistenceContext support entity-manager injected via @PersistenceContext
          Description it should

          //...
          public class MyBean
          {
              @PersistenceContext(unitName = "myPersistenceUnit")
              private EntityManager entityManager;

              @Transactional
              public void delete(Entity entity)
              {
                  this.entityManager.remove(em.merge(entity));
              }

              @PreDestroy
              public void cleanup()
              {
                  if(this.entityManager.isOpen())
                  {
                      this.entityManager.close();
                  }
              }
          }
          Gerhard Petracek made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Gerhard Petracek
              Reporter:
              Gerhard Petracek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development