Does NMG 2.1 support Nhibernate 3.0?

Feb 3, 2012 at 6:04 AM

I have use NMG 2.1 to generate entity and mapping from SQL server 2008, but the .hbm.xml mapping seems not correct under NHibernate 3.0 framework.


<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="Liansu.Lawmis.Model" namespace="Liansu.Lawmis.Model" xmlns="urn:nhibernate-mapping-2.2">
  <class name="mst_card_type" table="mst_card_type" lazy="true" >
    <id name="cardTypeID">
      <generator class="identity" />
      <column name="cardTypeID" sql-type="int" not-null="true" />

NH 3.0 seems not support 'column' tag in 'id' tag, the program will be error when runing with this mapping.

I just want to know, does NMG 2.1 only support NHibernate 3.2 only? Thanks.

Feb 11, 2012 at 7:51 AM

I have same problem, but i change in hbm.xml:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Liansu.Lawmis.Model" namespace="Liansu.Lawmis.Model" >

      <column name="cardTypeID" sql-type="int" not-null="true" />

       <generator class="identity" />

It's work.