NotificationDaoImpl.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:Equella 作者:
@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();
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号