I am in the middle of converting my appconfig.xml tp JavaConfigurations(AnnotationConfigs). I did converting most of the beans into JavaConfig. But I am got stuck with couple of beans which are listed below. Could some one help me on this..??
1.The Bean has a list element which takes values from a properties file.. The XML Configuration is :
<bean id="propertyCommons"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:dbUser.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
How do we convert this to java Config..(especially taking values from dbUser.properties?
2.How do we convert the following factory configuration to JavaConfigs?
.
.
.
<bean id="oozieJobFactoryBean" class="com.mycompany.product.dfe.main.OozieJobFactoryBean" />
<bean id="cmdArgs" class="com.mycompany.product.dfe.main.CmdArgs"
scope="prototype" />
<bean id="oozieJob" factory-bean="oozieJobFactoryBean"
factory-method="createJob" scope="prototype">
<constructor-arg ref="cmdArgs" />
</bean>
.
.
.
3. Also the following Configuration ..
.
.
.
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="productPU" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</property>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.cache.use_second_level_cache" value="true" />
<entry key="hibernate.cache.use_query_cache" value="true" />
<entry key="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.SingletonEhCacheProvider" />
<entry key="hibernate.show_sql" value="false" />
<entry key="hibernate.format_sql" value="false" />
<entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<entry key="javax.persistence.validation.mode" value="NONE" />
<entry key="hibernate.connection.characterEncoding" value="utf8" />
</map>
</property>
</bean>
.
.
.
Please help me on this am new to spring.. :) Thanks in Advance...
Noushad Ali.