hibernate 执行sql命令,参数顺序与SQL语句中顺序必须一致教程
hibernate 执行sql命令:
query.setString(0, processName);
query.setString(1, userId);
query.setString(2, workId);
SELECT ST.TASK\_ID FROM SBPM\_TASK ST" +
" LEFT JOIN SBPM\_PROCESS SP" +
" ON ST.PROCESS\_ID = SP.PROCESS\_ID" +
" LEFT JOIN SBPM\_ACTIVITY SA" +
" ON ST.TASK\_ID = SA.CURR\_TASK\_ID" +
" WHERE SP.PROCESS\_NAME = ?" +
" AND EXISTS (SELECT GROUPID" +
" FROM SBPM\_GROUPUSER SG" +
" WHERE USERID = ?" +
" AND ST.USER\_GROUP = SG.GROUPID)" +
" AND SA.WORK\_ID = ?"