<!-- Hibernate Framework Session Factory 등록 -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>gon/front/board/model/TbBoard.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>
<!-- Transaction Manager 를 설정하는 부분 -->
<bean id="transactionHibernateManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- Proxy FactoryBean -->
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionHibernateManager"/>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
application-board.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="communityDAOHibernate" class="gon.front.community.dao.CommunityDAOHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="communityServiceTarget" class="gon.front.community.service.CommunityService">
<property name="communityDAOHibernate" ref="communityDAOHibernate"/>
</bean>
<bean id="communityService" parent="txProxyTemplate">
<property name="target" ref="communityServiceTarget" />
</bean>
</beans>
'자바(JAVA)' 카테고리의 다른 글
spring 에서 Velocity framework 사용을 위한 설정 (1) | 2008.12.21 |
---|---|
set Inject 없이 컨테이너에 있는 빈객체를 가져와서 사용하는 방법 (0) | 2008.12.18 |
MessageSource 자동로딩과 방법 (0) | 2008.12.14 |
Eclipse Struts 플러그인 설치와 사용 (0) | 2008.12.13 |
MySQL 과 Oracle DBCP config.xml 기본연결설정정보 (0) | 2008.12.07 |
Multi Pool 구성 예 - config.xml (0) | 2008.12.07 |
Oracle RAC(Real Application Cluster) 구성 및 테스트 (0) | 2008.12.07 |
간단하게 spring batch 를 만들어 스케줄 프로그램하기 (0) | 2008.11.30 |