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...
[SOLVED]
<.exclude-unlisted-classes>true<./exclude-unlisted-classes> has solved my problem
<exclude-unlisted-classes>true</exclude-unlisted-classes>
with listing all entity classes (<class>com.mycompany.Foo</class>
etc.)? Preferably edit that info into the [SOLVED] part of your question. – Landreth