Hi,
i am trying to access .properties file data in .hbm.xml. please tell me steps to do this.
e.g. in propeties file we have
jdbc.primarykey=increment
and in hbm.xml i want to access with following way.
<hibernate-mapping>
*** <class name="com.spring.sample.*domain.User" table="USERS">***
*** *** <id name="id" column="USER_ID" type="java.lang.Long" unsaved-value="0">
*** *** *** <generator class="${jdbc.primarykey}"/>**** *** ***
*** *** </id>
** </class>
</hibernate-mapping>
it throws error present in hbm_propertiesError.txt present as an attachment.
************************************************** *************************************
Please help me to resolve this.
************************************************** *************************************
we can achieve this in .cfg.xml by following code
<beans>
*** <bean class="org.springframework.*beans.factory.config.* PropertyPlaceholderConfigurer"*>
*** *** <property name="locations">
*** *** *** <list>
******* *** *** <value>classpath:com/spring/*sample/properties/hibernate.*properties</value>******* *** ***
******* *** </list>
*** *** </property>
*** </bean>
* *** <bean id="dpwlsdataSource" class="org.springframework.*jdbc.datasource.*Drive rManagerDataSource" destroy-method="close">
*** *** <property name="driverClassName" value="${jdbc.driverClassName}*"/>
*** *** <property name="url" value="${jdbc.url}"/>***
*** *** <property name="username" value="${jdbc.username}"/>
*** *** <property name="password" value="${jdbc.password}"/>
* </bean>
</beans>
For more detail you can reach out to me @+91-98862-74713.


Reply With Quote
!