随笔 - 0  文章 - 29  trackbacks - 0
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

从2008年12月2日起访问者:
free hit counter
学习书籍、视频下载

留言簿

文章分类(16)

文章档案(17)

收藏夹(5)

Eclipse+MyEclipse

JAVA 相关工具下载网址

JSP服务器

Struts2

weblogic

学习网站

数据库

电子商务

搜索

  •  

最新评论

现象:
使用hql="from person" 出现" person is not mapped " 错误

配置文件如下:
<hibernate-mapping>
    <class name="src.Person"
           table="person">
        <id name="name"/>
      
        <property name="password"/>
    </class>
</hibernate-mapping>


原因:

hql是写的是PO对象,不是table名

故改为配置文件中的红色部分的类名即可。

posted on 2008-07-20 15:50 JEEF WANG 阅读(27969) 评论(15)  编辑  收藏 所属分类: Hibernate

FeedBack:
# re: "table" is not mapped 解决方法 2008-08-15 22:03 陈辉
thank you  回复  更多评论
  
# re: "table" is not mapped 解决方法 2008-08-20 11:06 amo
我也碰到这样的问题,照着上面的做法改了后就成功了。谢谢上面各位  回复  更多评论
  
# re: "table" is not mapped 解决方法 2008-09-28 10:12 i_mwaitingfory
<class name="com.demo.server.Tt" table="tt" schema="dbo" catalog="ss">

我是这样改的啊,有映射文件啊,但是用HQL编辑器查询它还是说"tt is not mapped"是怎么回事哦,我运行了测试代码也是这个结果.


麻烦高手们告诉我一下啊,小妹在此不胜感激,我留了我的博客地址,希望大家帮帮忙啊  回复  更多评论
  
# re: "table" is not mapped 解决方法[未登录] 2008-12-31 09:50 hehe
你在appcontext里没加下面这个吧?
<property name="mappingResources">
<list>
<value>com/smartempo/yainfo/po/YaFriendlink.hbm.xml</value>

</list>
</property>  回复  更多评论
  
# re: "table" is not mapped 解决方法 2010-09-19 17:08 11111
谢谢楼主,学习了~~~~3q  回复  更多评论
  
# re: "table" is not mapped 解决方法 2010-12-20 15:33 wxf
谢谢  回复  更多评论
  
# re: "table" is not mapped 解决方法[未登录] 2011-04-19 17:26 Eagle
@i_mwaitingfory
from Tt 而不是tt  回复  更多评论
  
# re: "table" is not mapped 解决方法 2011-07-06 19:39 贝壳里的海
搞定,就是这样滴  回复  更多评论
  
# re: "table" is not mapped 解决方法 2011-07-06 19:40 椒江在线
不错不错,就是这样的  回复  更多评论
  
# re: "table" is not mapped 解决方法 2011-08-18 16:23 王培聪
你应该改成Tt吧  回复  更多评论
  
# re: "table" is not mapped 解决方法 2012-01-04 16:51 567890
谢谢,自己想了很久都没解决,现在总算解决了。原来是这个问题。。  回复  更多评论
  
# re: "table" is not mapped 解决方法 2012-03-10 22:31 wuchx
太帅了,成功了  回复  更多评论
  
# re: "table" is not mapped 解决方法 2013-11-18 13:55 张俊
遇到同样问题,照你做了,OK 。谢谢  回复  更多评论
  
# re: "table" is not mapped 解决方法[未登录] 2015-01-21 14:59 qq
@567890
什么问题  回复  更多评论
  
# re: "table" is not mapped 解决方法[未登录] 2016-02-29 14:34 cc
谢谢!  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: