persistence.xml
在使用 struts2 ejb hibernate 的 Web 应用程序中,是否可以在部署时告诉应用程序为特定的持久性单元名称(写入文件中)查找或创建实体?
我persistence.xml
在 jboss 节点下有两个持久化单元和一个数据源(包括两个“local-tx-datasource”)xml 文件。
为了澄清,我的意思是,我试过这个;
@Entity
@PersistenceContext(unitName="MY JNDI NAME specified in persistence.xml")
public abstract class Vehicle {
并且不起作用..然后尝试了这个等等..
@PersistenceContext(name="MY PERSISTENCE UNIT NAME specified in persistence.xml")
@PersistenceUnit(name="MY PERSISTENCE UNIT NAME specified in persistence.xml")
而且我在上面用“UnitName = ..”而不是“name = ..”尝试了这些,但任何东西都对我有用......
[解决了]
<.exclude-unlisted-classes>true<./exclude-unlisted-classes> 解决了我的问题