Hibernate ORM FilterDefinition - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM FilterDefinition class.

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. 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Hibernate ORM FilterDefinition Methods: