zoukankan      html  css  js  c++  java
  • 【转】not found while looking for property错误

    原址:http://blog.csdn.net/y3wegy/article/details/7840813

    最近在研究Hibernate。过程当中碰到了很多问题啊!其中一个就是not found while looking for property错误

    Caused by: org.hibernate.MappingException: class main.java.POJO.User not found while looking for property: id

    配置文件如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="main.java.POJO">
    <class name="User" table="loginuser">
         <id name="id" column="Id" >
             <generator class="native"/>
         </id>
         <property name="username" column="username"  />
         <property name="password" column="password" />
         <property name="sex" column="sex"  />
    </class>
    </hibernate-mapping>

    修改成:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="main.java.POJO">
    <class name="User" table="loginuser">
         <id name="id" column="Id"  type="java.lang.Integer">
             <generator class="native"/>
         </id>
         <property name="username" column="username"  type="java.lang.String"/>
         <property name="password" column="password"  type="java.lang.String"/>
         <property name="sex" column="sex"  type="java.lang.String"/>
    </class>
    </hibernate-mapping>

  • 相关阅读:
    C#简单操作XML文件的增、删、改、查
    一个感觉还算可以的验证码生成程序
    安装aclocal1报错问题
    php中soap 的使用实例无需手写WSDL文件,提供自动生成WSDL文件类
    ofstream和ifstream详细用法[转]
    [原]C++ Soap客户端实例
    PHP中文件读、写、删的操作
    C++ Boost Thread 编程指南
    (转)虚函数和纯虚函数区别
    strcpy和memcpy的区别
  • 原文地址:https://www.cnblogs.com/chengxuzhixin/p/5549559.html
Copyright © 2011-2022 走看看