﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Vooctj-文章分类-J2EE</title><link>http://www.blogjava.net/vooctj/category/50556.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 02 Jan 2013 16:47:29 GMT</lastBuildDate><pubDate>Wed, 02 Jan 2013 16:47:29 GMT</pubDate><ttl>60</ttl><item><title>spring 和hibernate 常规配置</title><link>http://www.blogjava.net/vooctj/articles/393042.html</link><dc:creator>vooctj</dc:creator><author>vooctj</author><pubDate>Sat, 15 Dec 2012 09:24:00 GMT</pubDate><guid>http://www.blogjava.net/vooctj/articles/393042.html</guid><wfw:comment>http://www.blogjava.net/vooctj/comments/393042.html</wfw:comment><comments>http://www.blogjava.net/vooctj/articles/393042.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/vooctj/comments/commentRss/393042.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/vooctj/services/trackbacks/393042.html</trackback:ping><description><![CDATA[<div></div><fieldset><legend><span style="color: red;">applicationContext.xml</span></legend><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</div><div>&lt;beans xmlns="http://www.springframework.org/schema/beans"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;xmlns:aop="http://www.springframework.org/schema/aop"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;xmlns:tx="http://www.springframework.org/schema/tx"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;xmlns:context="http://www.springframework.org/schema/context"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;xsi:schemaLocation="http://www.springframework.org/schema/beans</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/aop&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/aop/spring-aop-2.5.xsd</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/context&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/context/spring-context-2.5.xsd</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/tx&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"&gt;</div><div></div><div></div><div><span style="white-space:pre;">	</span>&lt;!-- transactionManager --&gt;</div><div></div><div><span style="white-space:pre;">	</span>&lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;</div><div><span style="white-space:pre;"> </span>&lt;property name="sessionFactory"&gt;</div><div><span style="white-space:pre;"> </span>&lt;ref bean="sessionFactory"/&gt;</div><div><span style="white-space:pre;"> </span>&lt;/property&gt;</div><div><span style="white-space:pre;">	</span>&lt;/bean&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;!-- advice --&gt;</div><div><span style="white-space:pre;">	</span>&lt;tx:advice id="tx" transaction-manager="transactionManager"&gt;</div><div><span style="white-space:pre;"> </span>&lt;tx:attributes&gt;</div><div><span style="white-space:pre;"> </span>&lt;tx:method name="save*" &nbsp;isolation="DEFAULT" propagation="REQUIRED" read-only="false"/&gt;</div><div><span style="white-space:pre;"> </span>&lt;/tx:attributes&gt;</div><div><span style="white-space:pre;">	</span>&lt;/tx:advice&gt;</div><div></div><div><span style="white-space:pre;">	</span>&lt;!-- sessionFactory --&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;</div><div><span style="white-space:pre;"> </span>&lt;property name="configLocation" value="classpath:hibernate/hibernate.cfg.xml"&gt;</div><div><span style="white-space:pre;"> </span>&lt;/property&gt;</div><div><span style="white-space:pre;">	</span>&lt;/bean&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;"> </span>&lt;!-- aop &nbsp;--&gt;</div><div><span style="white-space:pre;">	</span>&lt;aop:config&gt;</div><div><span style="white-space:pre;"> </span>&lt;aop:pointcut expression="execution(* com.vooctj.service.impl.*.*(..))" id="perfom"/&gt;</div><div><span style="white-space:pre;"> </span>&lt;aop:advisor advice-ref="tx" pointcut-ref="perfom"/&gt;</div><div><span style="white-space:pre;">	</span>&lt;/aop:config&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;!-- entity studentDAO --&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;bean id="studentDAO" class="com.vooctj.dao.impl.StudentDAOImpl"&gt;</div><div><span style="white-space:pre;"> </span>&lt;property name="sessionFactory"&gt;</div><div><span style="white-space:pre;"> </span>&lt;ref bean="sessionFactory"/&gt;</div><div><span style="white-space:pre;"> </span>&lt;/property&gt;</div><div><span style="white-space:pre;">	</span>&lt;/bean&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;!-- entity studentService--&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;bean id="studentService" class="com.vooctj.service.impl.StudentServiceImpl"&gt;</div><div><span style="white-space:pre;"> </span>&lt;property name="studentDAO"&gt;</div><div><span style="white-space:pre;"> </span>&lt;ref bean="studentDAO"/&gt;</div><div><span style="white-space:pre;"> </span>&lt;/property&gt;</div><div><span style="white-space:pre;">	</span>&lt;/bean&gt;</div><div><span style="white-space:pre;">	</span></div><div><span style="white-space:pre;">	</span>&lt;/beans&gt;</div></fieldset><div></div><img src ="http://www.blogjava.net/vooctj/aggbug/393042.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/vooctj/" target="_blank">vooctj</a> 2012-12-15 17:24 <a href="http://www.blogjava.net/vooctj/articles/393042.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>