is not mapped [from错误
来源:互联网 发布:有赞 微盟 知乎 编辑:程序博客网 时间:2024/06/07 02:49
我出现的错误是:org.hibernate.hql.ast.QuerySyntaxException: loginuser is not mapped [from loginuser]
配置文件如下:
<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>
代码如下:
List<User> list=session.createQuery("from loginuser").list();
而出现这个错误的根本原因是hql语法里面是POJO对象而不是table.所以改成这样就可以了:
List<User> list=session.createQuery("from User").list();
特记于此!以备勿忘!
- is not mapped [from错误
- is not mapped [from错误
- is not mapped [from错误
- is not mapped [from
- is not mapped [from ***]
- 错误:is not mapped
- Hibernate出现错误:stock is not mapped from stock
- hibernate错误 xx is not mapped [from xxx]
- Hibernate is not mapped [from
- is not mapped 错误改正
- Argue is not mapped [from Argue]
- TbCustConsuServuser is not mapped [From TbCustConsuServuser cust]
- ssh is not mapped [FROM ssh]
- Procute is not mapped [from Procute]
- 出现org.hibernate.hql.internal.ast.QuerySyntaxException: goodsinfo is not mapped [from goodsinfo错误
- hibernate错误:org.hibernate.hql.ast.QuerySyntaxException: emp is not mapped [from emp]
- [SSH]HQL语句错误QuerySyntaxException: Student is not mapped [from Student stu order by stu.userna
- hibernate报a is not mapped[from a]
- [黑马]--第1天 网格布局管理器 GridLayout
- HDU 1042 N! + HDU1018 Big Number
- 用Java模拟Http请求
- C++虚函数表解析
- 黑马程序员--基础复习2012.8.7 交通灯管理系统
- is not mapped [from错误
- ASCII码表完整版
- 工具
- In C++, what’s a vtable and how does it work?
- [黑马] 第1天 多种布局管理器的使用
- 我不够好
- ODI与BAM集成自动配置集成脚本注意事项
- [黑马] 第1天 Swing实战-- 注册用户界面
- WPF设置全屏