日期:2014-05-19  浏览次数:20973 次

XML文件
大家好,如何用代码生成
<?xml   version= "1.0 "   encoding= "utf-8 "   ?>
<hibernate-configuration     xmlns= "urn:nhibernate-configuration-2.0 "   >
<session-factory   name= "NHibernate.Test ">
<!--   properties   -->
<property   name= "connection.provider "> NHibernate.Connection.DriverConnectionProvider </property>
<property   name= "connection.driver_class "> CMHDB.Driver.SqlClientDriver </property>
                                <property   name= "connection.Data_class "> System.Data.SqlClient </property>
<property   name= "connection.DBase_class "> CMHDB.DBOperation.sqlClientDBbase </property>
<property   name= "AutoIncrementSeed "> -1 </property>
<property   name= "AutoIncrementStep "> -1 </property>
<property   name= "connection.connection_string "> Data   Source=192.168.0.101;Initial   Catalog=TMHIS;Integrated   Security=True </property>
<property   name= "show_sql "> false </property>
<property   name= "dialect "> NHibernate.Dialect.MsSql2000Dialect </property>
<property   name= "use_outer_join "> true </property>
<!--  
these   are   different   than   the   values   in   app.config   so   I   can   verify   these  
are   being   picked   up
-->
<property   name= "command_timeout "> 444 </property>
<property   name= "query.substitutions "> true   1,   false   0,   yes   1,   no   0 </property>
<mapping   resource= "com/po/TblUser.hbm.xml "   />
<mapping   resource= "com/po/Userlist.hbm.xml "   />
<mapping   resource= "hibernatedb/Userlist.hbm.xml "   />
<!--   mapping   files   -->
<!--   are   now   optional
<mapping   file= "ABC.hbm.xml "   />
<mapping   resource= "NHibernate.DomainModel.Simple.hbm.xml "   assembly= "NHibernate.DomainModel "   />
-->
</session-factory>

</hibernate-configuration>

这样的文档

------解决方案--------------------
一个节点一个节点的添加吧
http://www.cnsdn.com.cn/blog/article.asp?id=785