bean def file

<'?xml version="1.0" encoding="UTF-8"?>
<'beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<'!-- service definition -->
<'bean id="sampleService" class="service.SampleServiceImpl">
<'property name="sampleDao">
<'ref local="sampleDaoImpl"/>
<'/property>
<'/bean>

<'bean id="sampleDaoImpl" class="dao.SampleDaoImpl">
<'property name="sessionFactory">
<'ref local="sessionFactory"/>
<'/property>
<'/bean>

<'!-- LocalDataSource HSQL -->
<'bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<'property name="driverClassName">
<'value>com.microsoft.sqlserver.jdbc.SQLServerDriver<'/value>
<'/property>
<'property name="url">
<'value>jdbc:postgresql://localhost:5432;sampleapp<'/value>
<'/property>
<'property name="username"><'value>un<'/value><'/property>
<'property name="password"><'value>pw<'/value><'/property>
<'/bean>


<'bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<'property name="dataSource">
<'ref local="dataSource"/>
<'/property>
<'property name="mappingResources">
<'list>
<'value>bean/sampleBean.hbm.xml<'/value>
<'/list>
<'/property>
<'property name="hibernateProperties">
<'props>
<'prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect<'/prop>
<'prop key="hibernate.show_sql">true<'/prop>
<'prop key="hibernate.use_outer_join">true<'/prop>
<'/props>
<'/property>
<'/bean>

<'!-- transactionManager -->
<'bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<'property name="sessionFactory" ref="sessionFactory"/>
<'/bean>

<'bean id="dao" class="dao.SampleDaoImple">
<'property name="sessionFactory" ref="sessionFactory"/>
<'/bean>

<'bean id="service"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<'property name="transactionManager" ref="transactionManager"/>
<'property name="target" ref="serviceTarget"/>
<'property name="transactionAttributes">
<'props>
<'prop key="query*">PROPAGATION_REQUIRED, readOnly<'/prop>
<'/props>
<'/property>
<'/bean>

<'bean id="serviceTarget" class="service.SampleServiceImpl">
<'property name="dao" ref="dao"/>
<'/bean>


<'/beans>

tag:
Hibernate

tag : Hibernate Spring ORM

2007-04-23 23:14 : engineering : コメント : 0 : トラックバック : 0 :
コメントの投稿
非公開コメント

« next  ホーム  prev »

search

ad



counter


tag cloud

category cloud