Multiple Persistence Units in JAVA EE project
Hello All,
If you are trying to create multiple persistence units in your JAVA EE project...the below is how you do it...I recently had to do this for one of my projects and it worked great...
Persistence.xml should look like below
provideryouareusing jdbc/db1 entity.entity1 entity.entity2 true jdbc/db2 entity.entity3 true
In the entity manager bean class you have to clearly specify which PU is the entity using...something like shown below...
@PersistenceContext(unitName="PUname")
let me know if you have any questions...
0 comments:
Post a Comment