<?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"
         xmlns:aop="http://www.springframework.net/aop">


  <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
    <property name="ConfigSections">
      <list>
        <value>fenixConfig</value>
      </list>
    </property>
  </object>


  <db:provider id="DbProvider" provider="System.Data.SqlClient"
               connectionString="${connectionStringFenixWeb}" />

  <object id="TransactionManager" type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate4">
    <property name="DbProvider" ref="DbProvider" />
    <property name="SessionFactory" ref="SessionFactory" />
    <property name="DefaultTimeout" value="3600" />
  </object>

  <tx:attribute-driven transaction-manager="TransactionManager" />

  <!--<object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate33">
        <property name="DbProvider" ref="DbProvider" />
        <property name="MappingAssemblies">
            <list>
                <value>Azapy.Domain.Repositories.NH</value>
            </list>
        </property>
        <property name="HibernateProperties">
            <dictionary>
                <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
                <entry key="dialect" value="NHibernate.Dialect.MySQL5Dialect" />
                <entry key="connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" />
                <entry key="connection.isolation" value="ReadUncommitted" />
                <entry key="show_sql" value="false" />
                <entry key="command_timeout" value="360" />
                <entry key="cache.provider_class" value="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache" />
                <entry key="cache.use_second_level_cache" value="true" />
                <entry key="cache.use_query_cache" value="false" />
                <entry key="cache.default_expiration" value="3600" />
                <entry key="adonet.batch_size" value="1000" />
            </dictionary>
        </property>
    </object>-->


  <object id="SessionFactory"
          type="MicroUniverso.Spring.Data.NHibernate.FluentNhibernateLocalSessionFactoryObject, MicroUniverso.Spring.Data.NHibernate">
    <property name="DbProvider" ref="DbProvider" />
    <property name="HibernateProperties">
      <dictionary>
        <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
        <entry key="dialect" value="NHibernate.Dialect.MsSql2008Dialect" />
        <entry key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
        <entry key="connection.isolation" value="ReadCommitted" />
        <entry key="current_session_context_class"
               value="Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate4" />
        <entry key="show_sql" value="false" />
        <entry key="command_timeout" value="360" />
        <entry key="cache.provider_class"
               value="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache" />
        <entry key="cache.use_second_level_cache" value="true" />
        <entry key="cache.use_query_cache" value="true" />
        <entry key="cache.default_expiration" value="3600" />
        <entry key="adonet.batch_size" value="1000" />
      </dictionary>
    </property>
    <property name="FluentNHibernateMappingAssemblies">
      <list>
        <value>MicroUniverso.Cliente.Repositorios.NH</value>
        <value>MicroUniverso.Dominio.Repositorios.NH</value>
        <value>MicroUniverso.Empresa.Repositorios.NH</value>
        <value>MicroUniverso.Empresa.Franquia.Repositorios.NH</value>
        <value>MicroUniverso.Financeiro.Repositorios.NH</value>
        <value>MicroUniverso.Fiscal.Repositorios.NH</value>
        <value>MicroUniverso.Fornecedor.Repositorios.NH</value>
        <value>MicroUniverso.Produto.Repositorios.NH</value>
        <value>MicroUniverso.Seguranca.Repositorios.NH</value>
        <value>MicroUniverso.Transporte.Repositorios.NH</value>
        <value>MicroUniverso.Venda.Repositorios.NH</value>
        <value>MicroUniverso.Vendedor.Repositorios.NH</value>
      </list>
    </property>
    <property name="FluentNHibernateExportDirectory" value="" />
  </object>


  <object id="HibernateTemplate" type="Spring.Data.NHibernate.Generic.HibernateTemplate">
    <property name="SessionFactory" ref="SessionFactory" />
    <property name="TemplateFlushMode" value="Auto" />
    <property name="CacheQueries" value="true" />
  </object>

  <object id="HibernateTemplateNonGeneric" type="Spring.Data.NHibernate.HibernateTemplate">
    <property name="SessionFactory" ref="SessionFactory" />
    <property name="TemplateFlushMode" value="Auto" />
    <property name="CacheQueries" value="true" />
  </object>

  <object id="AdoTemplate" type="Spring.Data.Generic.AdoTemplate">
    <property name="DbProvider" ref="DbProvider" />
    <property name="CommandTimeout" value="1200" />
  </object>

</objects>