Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5549

Add support for @PersistenceContexts and @PersistenceUnits

    Details

      Description

      See example here of using @PersistenceContexts.

      @Stateless
      @PersistenceContexts({
          @PersistenceContext(name="OrderEM"),
          @PersistenceContext(name="ItemEM")
      })
      public class OrderEntryBean implements OrderEntry {
          @Resource EJBContext ctx;
          public Customer getCustomer(int custID) {
              EntityManager em = (EntityManager)ctx.lookup("OrderEM");
              return em.find(Customer.class, custID);
          }
          public void enterItem(int orderID, Item newItem) {
              EntityManager em = (EntityManager)ctx.lookup("ItemEM");
          ...
          }
      } 
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  smarlow Scott Marlow
                  Reporter:
                  smarlow Scott Marlow
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: