zoukankan      html  css  js  c++  java
  • Hibernate配置文件

    var configuration = new NH.Cfg.Configuration();

    configuration.Configure(cfgPath);

    Configuration对象创建后,需要调用Configure()方法来加载配置文件,hibernate默认在app.config和web.config中查找配置,也可以指定配置文件的位置,通常设置为程序输出目录(bin)下“hibernate.cfg.xml”文件。

    程序方式配置

    var configuration = new NH.Cfg.Configuration();

    configuration.SetProperty("connection.provider", "NHibernate.Connection.DriverConnectionProvider");
    configuration.SetProperty("dialect", dialect);
    configuration.SetProperty("connection.driver_class", driver);
    configuration.SetProperty("connection.connection_string", connectionString);
    configuration.SetProperty("connection.release_mode", "on_close");
    configuration.SetProperty("show_sql", "true");

    configuration.AddAssembly("com.xxx");
    configuration.AddAssembly("com.yyy");
    configuration.AddAssembly("com.zzz");

    Configuration对象创建后不需要调用Configure()方法。

  • 相关阅读:
    PHP0002:PHP基础1
    NodeJS_0001:关于install的方式
    JN_0018:运行窗口不显示
    事务、事务操作、事务隔离级别
    MySQL 常见的两种存储引擎
    8:二叉树的下一个节点
    链表
    文件压缩
    MapReduce--Shuffle原理
    volatile关键字
  • 原文地址:https://www.cnblogs.com/davinci/p/3125467.html
Copyright © 2011-2022 走看看