Castle.ActiveRecord 的配置项

搞了一天了,对这个东东算是有点了解了~~非常晕。配置一定要准确,一点点小错都不行。


如下:
ACCESS和SQLITE在后面都需要加上:
<add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />

并且,ACCESS中的NHibernate.JetDriver.dll需要自己下载源码编绎;



    <configSections>
        <section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord"/>
        <!--<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />-->
    </configSections>
    <activerecord isWeb="true" isDebug="true">
        <config>
            <!--<add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
            <add key="dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
            <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
            <add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle"/>
            <add key="connection.connection_string" value="Server=localhost\yun;Initial Catalog=SmartPhoto;User Id=sa;Password=sa;"/>-->


            <!--<add key="connection.driver_class" value="NHibernate.JetDriver.JetDriver, NHibernate.JetDriver"/>
            <add key="dialect" value="NHibernate.JetDriver.JetDialect, NHibernate.JetDriver"/>
            <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
            <add key="connection.connection_string" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Work\B.mdb"/>
            <add value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" key="proxyfactory.factory_class" />-->

            <add key="connection.driver_class" value="NHibernate.Driver.SQLite20Driver" />
            <add key="dialect" value="NHibernate.Dialect.SQLiteDialect" />
            <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
            <add key="connection.connection_string" value="Data Source=E:\Work\B.db;Version=3" />
            <add key="query.substitutions" value="true=1;false=0"/>
            <add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />

        </config>
    </activerecord>

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 1 | 引用: 0 | 查看次数: 1120
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 支持Gravatar头像.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭