首页 技术 正文
技术 2022年11月15日
0 收藏 753 点赞 2,396 浏览 1309 个字
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驱动本身缺陷。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898