In spring 2.5.x, it can be done as follows:
Example Properties file:
persistenceUnitName=mysqlPunit
Spring context file snippet:
<context:property-placeholder location="classpath:config.properties"/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="${dbPersistentUnit}"/>
</bean>
The 'persistenceUnitName' will be changed to 'mysqlPunit' when the context is loaded in java.
No comments:
Post a Comment