Java Code Examples for org.hibernate.Session.getEnabledFilter()

The following are Jave code examples for showing how to use getEnabledFilter() of the org.hibernate.Session class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: HibernateTemplate.java   View Source Code Vote up 5 votes
@Override
public Filter enableFilter(String filterName) throws IllegalStateException {
	Session session = getSessionFactory().getCurrentSession();
	Filter filter = session.getEnabledFilter(filterName);
	if (filter == null) {
		filter = session.enableFilter(filterName);
	}
	return filter;
}
 
Example 2
Project: lams   File: HibernateTemplate.java   View Source Code Vote up 5 votes
@Override
public Filter enableFilter(String filterName) throws IllegalStateException {
	Session session = SessionFactoryUtils.getSession(getSessionFactory(), false);
	Filter filter = session.getEnabledFilter(filterName);
	if (filter == null) {
		filter = session.enableFilter(filterName);
	}
	return filter;
}