zoukankan      html  css  js  c++  java
  • NHibernate.cfg.xml文件配置

    代码
                     NHibernate.cfg.xml文件配置

    <?xml version="1.0" encoding="utf-8"?>
    <hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
        
    <session-factory name="NHibernate.Test">
            
    <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
            
    <property name="connection.connection_string">
          Data Source
    =.;database=NHibernateSample; uid=sa;pwd=123;
        
    </property>
            
    <property name="adonet.batch_size">10</property>
            
    <property name="show_sql">true</property>
            
    <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
            
    <property name="use_outer_join">true</property>
            
    <property name="command_timeout">10</property>
            
    <property name="query.substitutions">true 1false 0, yes 'Y', no 'N'</property>
        
    <mapping assembly="DomainModel"/>    
        
    </session-factory>
    </hibernate-configuration>
    //创建数据库
    public class DataBase
        {
            
    private void CreateDatabase()
            {
                Configuration cfg 
    = new Configuration();
                cfg.Configure();
                SchemaExport schema 
    = new SchemaExport(cfg);
                
    //schema.Drop(true, false);
                schema.SetOutputFile("log.txt");
                schema.Create(
    truefalse);
             }
         }
  • 相关阅读:
    删除ASP.net临时文件的操作步骤
    设置字段必录,但是直接点提交没有检查必录
    JavaWeb-Session
    Java集合类详解 转
    使用COS组件实现文件上传 转
    Java泛型详解 转
    java接口与工厂
    Vector和ArrayList的比较
    ArrayList
    关闭myeclipse自动校验特别是对js文件的校验
  • 原文地址:https://www.cnblogs.com/hubcarl/p/1706377.html
Copyright © 2011-2022 走看看