从学生ST那里ST.branch =:branch
setParameter(“ branch”,EC或CS)
谁能帮助我有效地编写此查询
答案 0 :(得分:0)
您可以改用IN
和setParameterList
-
List<String> branches = new ArrayList<String>();
branches.add("EC");
branches.add("CS");
From Student ST where ST.branch in (:branches)";
setParameterList("branches", branches);