]
Scott Marlow updated AS7-5549:
------------------------------
Summary: Add support for @PersistenceContexts and @PersistenceUnits (was:
Add support for @PersistenceContexts)
Git Pull Request:
Add support for @PersistenceContexts and @PersistenceUnits
----------------------------------------------------------
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-annotat...]
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: