public void enableMultiTenancyFilter ( ) { Serializable currentId = Tenants . currentId ( this ) ; if ( ConnectionSource . DEFAULT . equals ( currentId ) ) { disableMultiTenancyFilter ( ) ; } else { getHibernateTemplate ( ) . getSessionFactory ( ) . getCurrentSession ( ) . enableFilter ( GormProperties . TENANT_IDENTITY ) . setParameter ( GormProperties . TENANT_IDENTITY , currentId ) ; } }
Enable the tenant id filter for the given datastore and entity