@Override
@Transactional(propagation = Propagation.MANDATORY)
public int markProcessedById(final String user, final Collection<Long> notifications, final String attemptId)
{
if( notifications.isEmpty() )
{
return 0;
}
return (Integer) getHibernateTemplate().execute(new HibernateCallback()
{
@Override
public Object doInHibernate(Session session)
{
Query query = session.createQuery("update Notification set processed = true "
+ "where institution = :inst and userTo = :user and processed = false "
+ "and id in (:noteid) and attemptId = :attempt");
query.setParameter(ATTEMPT, attemptId);
query.setParameterList(NOTEID, notifications);
query.setParameter(USER, user);
query.setParameter(INST, CurrentInstitution.get());
return query.executeUpdate();
}
});
}
NotificationDaoImpl.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:Equella
作者:
评论列表
文章目录