In a web application using struts2 ejb hibernate, is it possible to tell the application to find or create an entity for a specific persistence-unit name, which is written in persistence.xml
file, in the deployment time?
I have two persistence-unit in persistence.xml
, and one datasource
(including two "local-tx-datasource") xml file under the jboss node.
To clearify, I mean, I tried this;
@Entity
@PersistenceContext(unitName="MY JNDI NAME specified in persistence.xml")
public abstract class Vehicle {
and doesnt work.. Then tried this and etc..
@PersistenceContext(name="MY PERSISTENCE UNIT NAME specified in persistence.xml")
@PersistenceUnit(name="MY PERSISTENCE UNIT NAME specified in persistence.xml")
and also I tried these above with the "UnitName=.." instead of "name=.." but anything is worked for me...