Java Code Examples for org.hibernate.Session#enableFilter()

The following examples show how to use org.hibernate.Session#enableFilter() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: spring-analysis-note   File: HibernateTemplate.java    License: MIT License 5 votes vote down vote up
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 2
Source Project: spring-analysis-note   File: HibernateTemplate.java    License: MIT License 5 votes vote down vote up
@Override
public Filter enableFilter(String filterName) throws IllegalStateException {
	Session session = obtainSessionFactory().getCurrentSession();
	Filter filter = session.getEnabledFilter(filterName);
	if (filter == null) {
		filter = session.enableFilter(filterName);
	}
	return filter;
}
 
Example 3
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 4
@Override
public Filter enableFilter(String filterName) throws IllegalStateException {
	Session session = obtainSessionFactory().getCurrentSession();
	Filter filter = session.getEnabledFilter(filterName);
	if (filter == null) {
		filter = session.enableFilter(filterName);
	}
	return filter;
}
 
Example 5
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see org.hibernate.Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 6
@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 7
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 8
@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 9
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see org.hibernate.Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 10
@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;
}
 
Example 11
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see org.hibernate.Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 12
@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;
}
 
Example 13
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 14
@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 15
/**
 * Enable the specified filters on the given Session.
 * @param session the current Hibernate Session
 * @see #setFilterNames
 * @see org.hibernate.Session#enableFilter(String)
 */
protected void enableFilters(Session session) {
	String[] filterNames = getFilterNames();
	if (filterNames != null) {
		for (String filterName : filterNames) {
			session.enableFilter(filterName);
		}
	}
}
 
Example 16
@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 17
protected void enableTenantFilter(Session session, String tenantId) {
	Filter filter = session.enableFilter(TENANT_FILTER_NAME);
	filter.setParameter("tenant", tenantId);
}