예제 #1
0
  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);
  }
예제 #2
0
  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);
  }