Untitled

 avatar
unknown
plain_text
3 months ago
682 B
8
Indexable
public boolean updateGroupRevisions(int groupId) {

		Session session = sessionFactory.openSession();
		Transaction transaction = null;

		try {

			transaction = session.beginTransaction();
			String sql = "UPDATE GroupRevisions SET currentRecord = 0 WHERE groupId =:groupId";
			Query query = session.createQuery(sql);
			query.setParameter("groupId", groupId);
			if (query != null) {
				int rows = query.executeUpdate();
			}
			transaction.commit();
			return true;

		} catch (Exception e) {
			LOGGER.debug("Exception in updateGroupRevisions() : " + e.getMessage());
			e.printStackTrace();

		} finally {
			session.close();
		}

		return true;
	}
Editor is loading...
Leave a Comment