mysql存入資料出錯總結

來源:互聯網
上載者:User

標籤:

ELECT t0.accusation_des, t0.submit_time, t0.result, t0.handle_time, t1.content,                t4.nick_name,t5.content,t6.ask_title ,t7.state_name,t8.item_name,t9.school_name,t10.school_name,t12.school_name,t14.school_name                FROM wxcommunity.t_accusation t0                 left join wxcommunity.t_comment t1 on t1.commentId = t0.commentId                 LEFT JOIN wxcommunity.t_ask t2 ON t2.askId = t1.askId                LEFT JOIN wxcommunity.t_school t9 ON t9.schoolId = t2.schoolId                LEFT JOIN wxcommunity.t_answer t3 ON t1.answer_id = t3.answer_id                LEFT JOIN wxcommunity.t_ask t11 on t11.askId = t3.askId                LEFT JOIN wxcommunity.t_school t12 ON t12.schoolId = t11.schoolId                LEFT JOIN wxcommunity.t_member t4 ON t4.userid = t0.userid                 left join wxcommunity.t_answer t5 on t5.answer_id = t0.answer_id                LEFT JOIN wxcommunity.t_ask t13 on t13.askId = t5.askId                LEFT JOIN wxcommunity.t_school t14 ON t14.schoolId = t13.schoolId                LEFT JOIN wxcommunity.t_ask t6 on t6.askId = t0.askId                LEFT JOIN wxcommunity.t_school t10 ON t10.schoolId = t6.schoolId                LEFT JOIN wxcommunity.t_handle_state t7 on t7.stateId = t0.stateId                LEFT JOIN wxcommunity.t_accusation_item t8 on t8.accusation_item_id = t0.accusation_item_id                WHERE (t0.askId > 0  OR  t0.answer_id > 0 OR t1.askId > 0 OR t1.answer_id > 0)

總結:1,帶有or邏輯關係的sql語句jpa查詢出錯,初步判斷jpa本身bug。

        2,上述語句在資料庫中直接查詢(navicat執行sql語句)沒問題,但是用在java代碼中執行 executeNativeSql()出錯,開始時因mysql-connector-java查詢出錯查不出資料,換了一個mysql-connector-java5.1.30的能查出資料但是還是有錯(查詢記錄老是少了一條)。初步判斷java代碼中mysql-connector-java驅動本身缺陷。

 

mysql存入資料出錯總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.