<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
         xmlns:db="http://www.springframework.net/database"
         xmlns:tx="http://www.springframework.net/tx">


  <!-- Database and NHibernate Configuration -->

  <db:provider id="DbProvider"
                   provider="SqlServer-2.0"
                   connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=Spring;Persist Security Info=True;User ID=springqa;Password=springqa;"/>



  <object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="MappingResources">
      <list>
        <value>assembly://Spring.Data.NHibernate.Tests/Spring.Data.NHibernate/TestObject.hbm.xml</value>
      </list>
    </property>
    <property name="HibernateProperties">
      <dictionary>
        <entry key="hibernate.dialect"
               value="NHibernate.Dialect.MsSql2000Dialect"/>
             
        <entry key="hibernate.connection.driver_class"
               value="NHibernate.Driver.SqlClientDriver"/>    

      </dictionary>
    </property>

  </object>


  <object id="TestObjectDao" type="Spring.Data.NHibernate.TestObjectDao, Spring.Data.NHibernate.Tests">
    <property name="SessionFactory" ref="SessionFactory"/>
  </object>

  <object id="hibernateTransactionManager" type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate">

    <property name="DbProvider" ref="DbProvider"/>
    <property name="sessionFactory" ref="SessionFactory"/>

  </object>

  <object name="transactionManager" type="Spring.Transaction.CallCountingTransactionManager, Spring.Data.Tests"/>

  <object name="SimpleService" type="Spring.Data.NHibernate.SimpleService, Spring.Data.NHibernate.Tests">
    <property name="TestObjectDao" ref="TestObjectDao"/>
  </object>

  <object id="loggingAroundAdvice" type="Spring.Data.LoggingAroundAdvice, Spring.Data.Tests"/>
  
  <object id ="myAutoProxy" type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator">

    <property name="InterceptorNames">
      <list>
        <value>loggingAroundAdvice</value>
      </list>
    </property>
    
    <property name="ProxyTargetType" value="false"/>
    <property name="ExposeProxy" value="false"/>
    <property name="Optimize" value="false"/>

    <property name="ObjectNames">
      <list>
        <value>TestObjectDao</value>
      </list>
    </property>
  </object>

  <tx:attribute-driven transaction-manager="transactionManager"/>
  
  <!-- Transactional Proxy for TestObjectDao using the TransactionProxyFactory -->
  <!--
  <object id="testObjectDaoTransProxy"
          type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">

    <property name="PlatformTransactionManager" ref="transactionManager"/>
    <property name="Target" ref="SimpleService"/>

    <property name="ProxyInterfaces" value="Spring.Data.NHibernate.ISimpleService"/>

    <property name="TransactionAttributes">
      <name-values>
        <add key="Create*" value="PROPAGATION_REQUIRED"/>
        <add key="Delete*" value="PROPAGATION_REQUIRED"/>
        <add key="Update*" value="PROPAGATION_REQUIRED"/>
        <add key="Find*"   value="PROPAGATION_REQUIRED"/>
      </name-values>
    </property>
  </object>
  -->

</objects>