<
bean
id
=
"sessionFactory"
class
=
"org.springframework.orm.hibernate3.LocalSessionFactoryBean"
>
<
property
name
=
"dataSource"
>
<
ref
bean
=
"DateResource"
></
ref
>
</
property
>
<
property
name
=
"hibernateProperties"
>
<
props
>
<
prop
key
=
"hibernate.dialect"
>
org.hibernate.dialect.SQLServerDialect
</
prop
>
</
props
>
</
property
>
<
property
name
=
"mappingResources"
>
<
list
>
<
value
>pojo/Employee.hbm.xml</
value
>
<
value
>pojo/Department.hbm.xml</
value
>
<
value
>pojo/Job.hbm.xml</
value
>
<
value
>pojo/Account.hbm.xml</
value
>
</
list
>
</
property
>
</
bean
>
|
法二:
<
bean
id
=
"sessionFactory"
class
=
"org.springframework.orm.hibernate3.LocalSessionFactoryBean"
>
<
property
name
=
"configLocation"
>
<
value
>classpath:hibernate_admin.cfg.xml</
value
>
</
property
>
<
property
name
=
"lobHandler"
>
<
ref
local
=
"oracleLobHandler"
/>
</
property
>
<
property
name
=
"hibernateProperties"
>
<
props
>
<
prop
key
=
"hibernate.show_sql"
>true</
prop
>
<!--<prop key="hibernate.hbm2ddl.auto">create</prop>
-->
</
props
>
</
property
>
</
bean
>