if(StringUtils.isNotBlank(qo.getOwnerShop())){ //cr.add(Restrictions.eq("quanType.ownerShop", qo.getOwnerShop())); String sql = String.format("EXISTS (SELECT * from q_type g where this_.quanType_ID=g.ID and ownerShop='%s' )", qo.getOwnerShop() ); cr.add(Restrictions.sqlRestriction( sql)); }
hibernate criteria 跨表查询
猜你喜欢
转载自xinglijun1973.iteye.com/blog/2343773
今日推荐
周排行