注意点:
首先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
>