注意点:
首先helloworld用的是hlsq in memory的数据库,将它改为oracle应用的时候,
首先要处理的就是model 包的实体类,去掉里面的文本生成属性,然后加上hibernate的
***.hbm.xml,然后用主键的生成<generator class=”uuid.hex”/>,然后在dataAccessContext-hibernate.xml中改:
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cache.use_query_cache">
${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.provider_class">
${hibernate.cache.provider_class}</prop>
</props>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>
classpath*:/org/springside/helloworld/hbm/
</value>
</list>
</property>
在applicationContext.xml中加进:
<!-- 属性文件读入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:config/jdbc.properties</value>
<value>classpath*:config/hibernate.properties</value>
</list>
</property>
</bean>
本文介绍如何将使用HLSQInMemory数据库的应用迁移至Oracle数据库的过程,包括实体类的调整、Hibernate配置文件(dataAccessContext-hibernate.xml)的修改以及属性文件的引入等关键步骤。
2806

被折叠的 条评论
为什么被折叠?



