Nhibernate 困扰我一个星期的问题 终于解决了
在CSDN上发了帖了,向飞鹰 、张老三等发了EMail,都没有回映,抱着试试看的态度在 SF上的EMAIL LIST上发了个帖子,没有想到10分钟不到 就有一位朋友给我解决了问题,还亲自在我的blog上回附了,真是感动啊,不过说起这个捆挠我一个星期的问题 所犯的错误 还真是低级
原来 我把字段的长度 写在 字段名的,后面了
我的错误的文件:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="pb.testdal.Db.users, testdal1" table="users">
<LogonID name="LogonID" column="LogonID" type="String(20)">
<generator class="assigned" />
</LogonID>
<property name="Name" type="String" column="Name(40)"/>
<property name="Password" type="String" column="Password(20)"/>
<property name="EmailAddress" type="String" column="EmailAddress(20)"/>
<property name="LastLogon" type="DateTime" column="LastLogon" />
</class>
</hibernate-mapping>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="pb.testdal.Db.users, testdal1" table="users">
<LogonID name="LogonID" column="LogonID" type="String(20)">
<generator class="assigned" />
</LogonID>
<property name="Name" type="String" column="Name(40)"/>
<property name="Password" type="String" column="Password(20)"/>
<property name="EmailAddress" type="String" column="EmailAddress(20)"/>
<property name="LastLogon" type="DateTime" column="LastLogon" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="pb.testdal.Db.users, testdal1" table="users">
<id name="ID" column="LogonID" type="String(20)">
<generator class="assigned" />
</id>
<property name="Name" type="String(40)" column="Name"/>
<property name="Password" type="String(20)" column="Password"/>
<property name="EmailAddress" type="String(20)" column="EmailAddress"/>
<property name="LastLogon" type="DateTime" column="LastLogon" />
</class>
</hibernate-mapping>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="pb.testdal.Db.users, testdal1" table="users">
<id name="ID" column="LogonID" type="String(20)">
<generator class="assigned" />
</id>
<property name="Name" type="String(40)" column="Name"/>
<property name="Password" type="String(20)" column="Password"/>
<property name="EmailAddress" type="String(20)" column="EmailAddress"/>
<property name="LastLogon" type="DateTime" column="LastLogon" />
</class>
</hibernate-mapping>
不仔细看 还真看不出来