@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
public List<OpUsrrole> OpUsrroleExList(List<OpUsrrole> grprole) {
ArrayList<Long> ids = new ArrayList<Long>();
for(int i=0;i<grprole.size();i++){
ids.add(grprole.get(i).getIRoleid());
System.out.println(ids.get(i).toString());
}
Query q = sessionFactory.getCurrentSession().createQuery("select distinct rl from OpUsrrole rl where rl.IRoleid not in(:ids)");
q.setParameterList("ids", ids);
return q.list();
}
String+hibernate
本文介绍了一个使用Hibernate框架实现的Java方法,该方法通过注解控制事务传播行为,并从数据库中查询不属于特定角色集合的角色列表。
1900

被折叠的 条评论
为什么被折叠?



