[jboss-jira] [JBoss JIRA] (AS7-5549) Add support for @PersistenceContexts

Scott Marlow (JIRA) jira-events at lists.jboss.org
Thu Sep 13 10:08:32 EDT 2012


Scott Marlow created AS7-5549:
---------------------------------

             Summary: Add support for @PersistenceContexts
                 Key: AS7-5549
                 URL: https://issues.jboss.org/browse/AS7-5549
             Project: Application Server 7
          Issue Type: Bug
          Components: JPA / Hibernate
    Affects Versions: 7.1.1.Final
            Reporter: Scott Marlow
            Assignee: Scott Marlow
             Fix For: 7.2.0.Alpha1


See [example here|http://www.oracle.com/technetwork/middleware/ias/toplink-jpa-annotations-096251.html] of using @PersistenceContexts.

{code}
@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");
    ...
    }
} 
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list