public void disableAuthorizationFilter() { HibernateCallback<Object> cb = new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { session.disableFilter("authorizedOnly"); return null; } }; ((AlarmDaoHibernate) m_alarmDao).getHibernateTemplate().execute(cb); }
public void enableAuthorizationFilter(final String... groupNames) { HibernateCallback<Object> cb = new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException, SQLException { session.enableFilter("authorizedOnly").setParameterList("userGroups", groupNames); return null; } }; ((AlarmDaoHibernate) m_alarmDao).getHibernateTemplate().execute(cb); }