您好我想使用条件编写查询: 必须使用条件创建以下查询:
“从S2选择Distinct(s2Taxper),其中s2Tc ='601'AND s2Txcd!=''”
提前致谢
答案 0 :(得分:38)
Criteria criteria =
session.createCriteria(S2.class)
.add(Restrictions.eq("s2Tc","601"))
.add(Restrictions.ne("s2Txcd",""))
.setProjection(Projections.distinct(Projections.property("s2Taxper")));