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);
             }
         }
  • 相关阅读:
    MySQL常用函数及逻辑运算
    博客主题2
    TCPIP详解第1卷1.3TCPIP分层1.4互联网的地址1.5域名系统1.6封装
    删除数组中满足特定需求的数字
    自定义简洁浏览器主页
    Matlab图像处理函数:regionprops
    连通域的质心
    Matlab的GUI参数传递方式总结
    retrifit
    association ,collection
  • 原文地址:https://www.cnblogs.com/hubcarl/p/1706377.html
Copyright © 2011-2022 走看看