1
我想要做這樣的事情閱讀我的persistence.xml
config.properties:
dsname=value;
anotherValue=anotherValue;
persitence.xml
<jta-data-source>${dsname}</jta-data-source>
我想要做這樣的事情閱讀我的persistence.xml
config.properties:
dsname=value;
anotherValue=anotherValue;
persitence.xml
<jta-data-source>${dsname}</jta-data-source>
屬性文件是我的web項目中,我使用JPA與Eclip之外seLink但我需要初始化參數JTA數據源來自外部文件值「DSNAME」
實際上:
<persistence-unit name="Unit-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>datasource</jta-data-source>
<class>Clase1</class>
<class>Clase2</class>
<class>Clase3</class>
<properties/>
</persistence-unit>
主意,使:
<persistence-unit name="Unit-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>${dsname}</jta-data-source>
<class>Clase1</class>
<class>Clase2</class>
<class>Clase3</class>
<properties/>
</persistence-unit>
使用這些文件與任何庫,或者你會直接從Java代碼讀取它們? –
問題是什麼?什麼沒有用? – Junuxx