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

    <d:provider id="DbProvider" 
               provider="System.Data.SqlClient"
               connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=Spring;User ID=springqa; Password=springqa"/>

  <object name="LoggingAdvice" type="Spring.Aspects.Logging.SimpleLoggingAdvice, Spring.Aop">
    <property name="logUniqueIdentifier" value="true"/>
    <property name="logExecutionTime"    value="true"/>
    <property name="logMethodArguments"  value="true"/>

    <property name="Separator"           value=";"/>
    <property name="LogLevel"            value="Info"/>

    <property name="HideProxyTypeNames"  value="true"/>
    <property name="UseDynamicLogger"    value="true"/>
  </object>

  <object id="SetterAndMethodLoggingAdvisor" type="Spring.Aop.Support.RegularExpressionMethodPointcutAdvisor, Spring.Aop">
    <property name="advice" ref="LoggingAdvice" />
    <property name="pattern" value=".*" />
  </object>
  
    <object id="Parent" 
          type="Spring.Objects.TestObject,Spring.Core.Tests">
            
        <property name="name" value="Parent"/>
    </object>


    <object id="adoTemplate" 
            type="Spring.Data.Core.AdoTemplate, Spring.Data">
            
        <property name="DbProvider" ref="DbProvider"/>                
    </object>

    <object id="testObjectDao" 
            type="Spring.Data.TestObjectDao, Spring.Data.Integration.Tests">
            
        <property name="AdoTemplate" ref="adoTemplate"/>
    </object>
    
        
    <object id="adoTransactionManager" 
            type="Spring.Data.Core.AdoPlatformTransactionManager, Spring.Data">
            
        <property name="DbProvider" ref="DbProvider"/>
    </object>
    
    <!-- Transaction AutoProxy based on Name for TestObjetManager -->
    <object name="autoProxyCreator"
            type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop">

      <property name="InterceptorNames">
        <list>
          <value>SetterAndMethodLoggingAdvisor</value>
          <value>transactionInterceptor</value>
        </list>
      </property>
      <!--
        <property name="InterceptorNames" value="transactionInterceptor"/>
        -->
        <property name="ObjectNames">
            <list>
                <idref local="testObjectManager"/>
            </list>
        </property>
    </object>
    
    <object id="testObjectManager" 
            type="Spring.Data.TestObjectManager, Spring.Data.Integration.Tests">
        
        <property name="TestObjectDao" ref="testObjectDao"/>
    </object>
    
    <!-- Transactional Proxy for TestObjectManager using the TransactionProxyFactory -->
    <object id="testObjectManagerTP" 
            type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
        
        <property name="PlatformTransactionManager" ref="adoTransactionManager"/>
        <property name="Target">
            <object type="Spring.Data.TestObjectManager, Spring.Data.Integration.Tests">
                <property name="TestObjectDao" ref="testObjectDao"/>
            </object>
        </property> 
        <property name="TransactionAttributes">
            <name-values>
                <add key="Save*" value="PROPAGATION_REQUIRED"/>
                <add key="Delete*" value="PROPAGATION_REQUIRED"/>
            </name-values>
        </property>
    </object>
    
    <!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->
    <object id="testObjectManagerPF" 
            type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
        
        <property name="Target" ref="testObjectManagerTarget"/>
        <property name="ProxyInterfaces">
            <value>Spring.Data.ITestObjectManager</value>
        </property>
        <property name="InterceptorNames">
            <value>transactionInterceptor</value>
        </property>      
        
    </object>
    
    <!-- Transaction Interceptor -->
    <object id="transactionInterceptor" 
            type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
        <property name="TransactionManager" ref="adoTransactionManager"/>
        <!-- note do not have converter from string to this property type registered -->
        <property name="TransactionAttributeSource" ref="methodMapTransactionAttributeSource"/>        
    </object>
    
    <object name="methodMapTransactionAttributeSource" 
            type="Spring.Transaction.Interceptor.MethodMapTransactionAttributeSource, Spring.Data">
        <property name="MethodMap">
           <dictionary>           
              <entry key="Spring.Data.TestObjectManager.SaveTwoTestObjects, Spring.Data.Integration.Tests" 
                     value="PROPAGATION_REQUIRED"/>
              <entry key="Spring.Data.TestObjectManager.DeleteTwoTestObjects, Spring.Data.Integration.Tests" 
                     value="PROPAGATION_REQUIRED"/>                     
           </dictionary>        
        </property>     
    </object>
    
    <!-- The DAO object that performs multiple data access operations -->
    <object id="testObjectManagerTarget" type="Spring.Data.TestObjectManager, Spring.Data.Integration.Tests">
        <property name="TestObjectDao" ref="testObjectDao"/>
    </object>
    



    
    
</objects>