zoukankan      html  css  js  c++  java
  • 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>
    正确的应为:
    <?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>

    不仔细看 还真看不出来
  • 相关阅读:
    019_linuxC++之_函数模板引入
    018_linuxC++之_抽象类的引入
    017_linuxC++之_多态的引入
    《将博客搬至CSDN》
    016_linuxC++之_多重继承
    013_linuxC++之_派生类中权限的调整
    015_linuxC++之_覆写
    014_linuxC++之_不同类型的继承
    012_linuxC++之_类的继承定义
    011_linuxC++之_继承的引入
  • 原文地址:https://www.cnblogs.com/9527/p/51594.html
Copyright © 2011-2022 走看看