隨筆 - 0  文章 - 29  trackbacks - 0
          <2011年4月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          從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 閱讀(28007) 評論(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
          謝謝!  回復  更多評論
            

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 宜兴市| 古浪县| 镇原县| 交城县| 滦南县| 奇台县| 盐边县| 卢龙县| 新野县| 忻城县| 集贤县| 安吉县| 湘潭县| 岑溪市| 砚山县| 白玉县| 额敏县| 大英县| 普格县| 石渠县| 紫金县| 广丰县| 新竹县| 曲水县| 梁平县| 北安市| 西乡县| 炎陵县| 灵璧县| 柞水县| 洪湖市| 政和县| 宜川县| 永丰县| 凌云县| 蓬安县| 玛多县| 油尖旺区| 于都县| 东乡县| 海宁市|