hibernate下的hql语句太长,如何修改

getManagerHql=selectm.customID,u.userNamefromCstCustomManagerm,SysUseruwherem.userID=... getManagerHql =
select m.customID, u.userName from CstCustomManager m, SysUser
u where m.userID = u.ID and m.customID in (1207, 1208, 1209, 1210, 1211, 1212,
1213, 1214, 1215, 454, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225,
1226, 1227, 1228, 1229, 1216, 8012, 1230, 1231, 1232, 1233, 1234, 1235, 1236,
1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249,
1250, 1251, 1252, 1253, 1254, 1255, 1260, 1261, 1262, 1263, 1264, 1265, 1266,
1267, 1268, 1269, 1256, 1257, 1258, 1259.......); (....后面很长很长)
使用getHibernateTemplate().find(getManagerHql)查询时抛异常

严重: Servlet.service() for servlet default threw exception
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -101, SQLSTATE: 54001, SQLERRMC: null
at com.ibm.db2.jcc.c.fg.e(fg.java:1596)
at com.ibm.db2.jcc.c.fg.a(fg.java:1206)
at com.ibm.db2.jcc.b.gb.g(gb.java:140)
at com.ibm.db2.jcc.b.gb.a(gb.java:39)
at com.ibm.db2.jcc.b.w.a(w.java:34)
at com.ibm.db2.jcc.b.vb.g(vb.java:139)
at com.ibm.db2.jcc.c.fg.n(fg.java:1177)
at com.ibm.db2.jcc.c.gg.eb(gg.java:1862)
at com.ibm.db2.jcc.c.gg.d(gg.java:2295)
at com.ibm.db2.jcc.c.gg.V(gg.java:424)

急求高手,谢谢。
我考 ,xiaoxing189,你那我找乐是么?
展开
 我来答
汲白夏侯F9
2009-03-14
知道答主
回答量:13
采纳率:0%
帮助的人:0
展开全部
getManagerHql =
select m.customID, u.userName from CstCustomManager m, SysUser
u where m.userID = u.ID and m.customID in (1207, 1208, 1209, 1210, 1211, 1212,
1213, 1214, 1215, 454, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225,
1226, 1227, 1228, 1229, 1216, 8012, 1230, 1231, 1232, 1233, 1234, 1235, 1236,
1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249,
1250, 1251, 1252, 1253, 1254, 1255, 1260, 1261, 1262, 1263, 1264, 1265, 1266,
1267, 1268, 1269, 1256, 1257, 1258, 1259.......); (....后面很长很长)
使用getHibernateTemplate().find(getManagerHql)查询时抛异常

严重: Servlet.service() for servlet default threw exception
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -101, SQLSTATE: 54001, SQLERRMC: null
at com.ibm.db2.jcc.c.fg.e(fg.java:1046)
at com.ibm.db2.jcc.c.fg.a(fg.java:1456)
at com.ibm.db2.jcc.b.gb.g(gb.java:140地)
at com.ibm.db2.jcc.b.gb.a(gb.java:39f)
at com.ibm.db2.jcc.b.w.a(w.java:34)
at com.ibm.db2.jcc.b.vb.g(vb.java:139a)
at com.ibm.db2.jcc.c.fg.n(fg.java:1177)
at com.ibm.db2.jcc.c.gg.eb(gg.java:1862a)
at com.ibm.db2.jcc.c.gg.d(gg.java:22095)
at com.ibm.db2.jcc.c.gg.V(gg.java:424)
at com.ibm.db2.jcc.b.gb.a(gb.java:422)
明白了吧!!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
audi3
2009-03-02
知道答主
回答量:14
采纳率:0%
帮助的人:0
展开全部
and (m.customID > 1207 and and m.customID < ....) 我发现这些是连号的。如果有个别排除可以 and m.customID not in (...)
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式