当前位置:Gxlcms > 数据库问题 > mysql存入数据出错总结

mysql存入数据出错总结

时间:2021-07-01 10:21:17 帮助过:3人阅读

= 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存入数据出错总结

标签:

人气教程排行