欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
Hibernate Mapping 中的catalog屬性導制生成HQL時(shí)報錯!_~小雨_...

<hibernate-mapping>
     <class name="com.zhidao.model.ZdQuestion" table="zd_question" catalog="zhidao">
         <id name="zdId" type="int">
             <column name="zd_id" />
             <generator class="identity" />
         </id>
         <property name="zdTitle" type="string">
             <column name="zd_title" length="45" not-null="true" />
         </property>
         <property name="zdContent" type="string">
             <column name="zd_content" length="45" not-null="true" />
         </property>
         <property name="zdTime" type="timestamp">
             <column name="zd_time" length="19" not-null="true" />
         </property>
         <property name="zuId" type="int">
             <column name="zu_id" not-null="true" />
         </property>
         <property name="zdMoney" type="int">
             <column name="zd_money" not-null="true" />
         </property>
         <property name="zdGroup" type="string">
             <column name="zd_group" length="45" not-null="true" />
         </property>
         <property name="zdIsQuestion" type="int">
             <column name="zd_isQuestion" not-null="true" />
         </property>
         <property name="zdIsbest" type="int">
             <column name="zd_isbest" not-null="false" />
         </property>
     </class>
</hibernate-mapping>

報錯:
execute method getDaoImp()
查詢(xún)方法:searchPager():from ZdQuestion   a
2007-07-28 13:32:07,906 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2007-07-28 13:32:07,953 [org.springframework.jdbc.support.SQLErrorCodesFactory]-[INFO] SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
Hibernate: select zdquestion0_.zd_id as zd1_, zdquestion0_.zd_title as zd2_1_, zdquestion0_.zd_content as zd3_1_, zdquestion0_.zd_time as zd4_1_, zdquestion0_.zu_id as zu5_1_, zdquestion0_.zd_money as zd6_1_, zdquestion0_.zd_group as zd7_1_, zdquestion0_.zd_isQuestion as zd8_1_, zdquestion0_.zd_isbest as zd9_1_ from zhidao__zd_question zdquestion0_ limit ?
2007-07-28 13:32:08,093 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 1146, SQLState: 42S02
2007-07-28 13:32:08,093 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] Table 'zhidao.zhidao__zd_question' doesn't exist
org.hibernate.exception.SQLGrammarException: could not execute query
         at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.loader.Loader.doList(Loader.java:1596)
         at org.hibernate.loader.Loader.list(Loader.java:1577)
         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:890)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
         at com.zhidao.dao.DaoImp.searchPager(DaoImp.java:27)
         at com.zhidao.service.ServiceImp.listData(ServiceImp.java:82)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy1.listData(Unknown Source)
         at com.zhidao.struts.action.AskAaction.simpleSearchAsk(AskAaction.java:88)
         at com.zhidao.struts.action.AskAaction.execute(AskAaction.java:56)
Caused by: java.sql.SQLException: Table 'zhidao.zhidao__zd_question' doesn't exist
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)
         at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75)
         at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
         at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
         at org.hibernate.loader.Loader.doQuery(Loader.java:391)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
         at org.hibernate.loader.Loader.doList(Loader.java:1593)
         ... 54 more


從上面的錯誤可以看出,錯誤在zhidao.zhidao__zd_question 表名上,
這個(gè)錯誤是說(shuō)沒(méi)有找到表名:Caused by: java.sql.SQLException: Table 'zhidao.zhidao__zd_question' doesn't exist
其實(shí)我數據庫里的表名是zd_question但為什么又在前面加上了zhidao__了呢?這個(gè)是我數據庫的數名啊~??!汗~!
后來(lái)發(fā)現
<class name="com.zhidao.model.ZdQuestion" table="zd_question" catalog="zhidao">
多了這個(gè)~!“catalog="zhidao" ”這個(gè)地方是把庫名放在上面了,當生成Hibernate生成SQL語(yǔ)句時(shí)把表名前又加上了庫名,所以報錯了~!

下面讓我改了,馬上就好使了~!汗~??!
<hibernate-mapping package="com.zhidao.model">
     <class name="ZdQuestion" table="zd_question">
         <id name="id" type="int">
             <column name="id" />
             <generator class="identity" />
         </id>
         <property name="zdTitle" type="string">
             <column name="zd_title" length="45" not-null="true" />
         </property>
         <property name="zdContent" type="string">
             <column name="zd_content" length="45" not-null="true" />
         </property>
         <property name="zdTime" type="timestamp">
             <column name="zd_time" length="19" not-null="true" />
         </property>
         <property name="zuId" type="int">
             <column name="zu_id" not-null="true" />
         </property>
         <property name="zdMoney" type="int">
             <column name="zd_money" not-null="true" />
         </property>
         <property name="zdGroup" type="string">
             <column name="zd_group" length="45" not-null="true" />
         </property>
         <property name="zdIsQuestion" type="int">
             <column name="zd_isQuestion" not-null="true" />
         </property>
         <property name="zdIsbest" type="int">
             <column name="zd_isbest" not-null="false" />
         </property>
     </class>
</hibernate-mapping>


本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Spring4新特性
hibernate多表查詢(xún)檢索的幾種方法。二
無(wú)需容器的對象關(guān)系映射
一個(gè)用myeclipse開(kāi)發(fā)hibernate的入門(mén)例子 - 我愛(ài)JAVA - BlogJ...
Hibernate Shards 數據的水平、垂直切割(一)- Hibernate測試環(huán)境
在 Eclipse's RCP中配置Hibernate
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久