dimanche 15 mars 2015

persistence.xml property values from properties file

I have below configuration for entityManger



<jee:jndi-lookup id="dataSource" expected-type="javax.sql.DataSource"
jndi-name="java:jboss/datasources/AppDS"/>

<jee:jndi-lookup id="entityManagerFactory"
expected-type="javax.persistence.EntityManagerFactory"
jndi-name="java:comp/env/persistence/fusePersistenceUnit"/>


I also have persistence.xml file, now I want to add hibernate-search feature to my application, so I have added below properties in my persistence.xml file ..



<property name="hibernate.search.default.directory_provider" value="filesystem" />
<property name="hibernate.search.default.indexBase" value="/var/lucene/indexes" />


Here I want to externalize indexBase property value to properties file, something like this.



<property name="hibernate.search.default.indexBase" value="${index.location}" />


Can any please suggest how I can achieve this ?


I am using Spring version : 4.


Thanks.


Aucun commentaire:

Enregistrer un commentaire