[jboss-jira] [JBoss JIRA] (AS7-5549) Add support for @PersistenceContexts and @PersistenceUnits
Scott Marlow (JIRA)
jira-events at lists.jboss.org
Sun Sep 16 21:11:34 EDT 2012
[ https://issues.jboss.org/browse/AS7-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Scott Marlow updated AS7-5549:
------------------------------
Summary: Add support for @PersistenceContexts and @PersistenceUnits (was: Add support for @PersistenceContexts)
Git Pull Request: https://github.com/jbossas/jboss-as/pull/3053 (was: https://github.com/jbossas/jboss-as/pull/3053)
> 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-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