2011-07-13 59 views
1

我在Websphere Application Server V7.0上部署了我的ear文件並啓動應用程序。但是,它不會自動爲我的數據庫DB2創建表並且沒有任何錯誤消息。在Websphere Application Server上部署時,OpenJPA不會創建DB2表

請參閱我persitence.xml文件

<?xml version="1.0" encoding="UTF-8" ?> 
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"> 
<persistence-unit name="xcrm_ejb" > 
<jta-data-source>jdbc/xcrm</jta-data-source> 
<non-jta-data-source>jdbc/non_xcrm</non-jta-data-source> 
<mapping-file>META-INF/orm.xml</mapping-file> 
<class>ch.xpertline.xcrm.entity.base.BaseEntity</class> 
<class>ch.xpertline.xcrm.entity.Address</class> 
<exclude-unlisted-classes>true</exclude-unlisted-classes> 
<properties> 
<property name="openjpa.Log" value="DefaultLevel=INFO,SQL=TRACE,File=./dist/jpaEnhancerLog.log,Runtime=INFO,Tool=INFO"/> 
<property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72"/> 
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/> 
</properties> 
</persistence-unit> 
</persistence> 

我orm.xml文件:

<?xml version="1.0" encoding="UTF-8"?> 
<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"> 
<persistence-unit-metadata> 
<persistence-unit-defaults> 
<schema>soreco</schema> 
</persistence-unit-defaults> 
</persistence-unit-metadata> 
</entity-mappings> 

感謝

回答

0

嘗試在應用程序中請求發送。我不認爲在創建第一個EntityManager之前觸發同步映射。

相關問題