Best code examples for Hibernate ORM FilterDefinition class (org.hibernate.engine.spi.FilterDefinition)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM FilterDefinition class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM FilterDefinition examples from Open Source projects
This code example shows how to use the following methods: getParameterType
	 */ 
	public Filter setParameter(String name, Object value) throws IllegalArgumentException {
		// Make sure this is a defined parameter and check the incoming value type 
		// TODO: what should be the actual exception type here? 
		Type type = definition.getParameterType( name );
		if ( type == null ) {
			throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
		} 
		if ( value != null && !type.getReturnedClass().isAssignableFrom( value.getClass() ) ) {
			throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
		} 
		parameters.put( name, value );
		return this;
	} 
 
	/** 
	 * Set the named parameter's value list for this filter.  Used 
	 * in conjunction with IN-style filter criteria. 
	 * 
	 * @param name   The parameter's name. 
Full Snippet Info
4
CodeRank
See Code Examples for Hibernate ORM FilterDefinition Methods: