2024年5月11日发(作者:)

spring4.x + hibernate4.x 配置详解

关于spring和hibernate的使用以及特征等等,在此不再啰嗦,相信大家也都知道,或者去搜

索一下即可。

本篇博文的内容主要是我最近整理的关于spring4.x 和 hibernate 4.x 相关配置和使用方式,

当然spring3.x以及hibernate4.x也可以借鉴。

首先是配置文件 增加以下代码即可

contextConfigLocation

classpath*:/

tLoaderListener

istener-class>

然后建立 文件 ,src下。 文件内容如下,注释我尽量写的很详细

xmlns="/schema/beans" xmlns:aop="ww

/schema/aop"

xmlns:context="/schema/context" xmlns:tx="ht

tp:///schema/tx"

xmlns:cache="/schema/cache" xmlns:p="

/schema/p"

xsi:schemaLocation="/schema/beans

/schema/beans/

/schema/aop

/schema/aop/

/schema/context

/schema/context/

/schema/tx

/schema/tx/

/schema/cache framewor

/schema/cache/">

e"

destroy-method="close">

class="essionFactoryBean">

t=ialect

=update

_sql=true

_sql=true

_second_level_cache=false

_query_cache=false

_size=50