org.hibernate.usertype.ParameterizedType Java Examples

The following examples show how to use org.hibernate.usertype.ParameterizedType. 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 check out the related API usage on the sidebar.
Example #1
Source File: TypeFactory.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public static void injectParameters(Object type, Properties parameters) {
	if ( ParameterizedType.class.isInstance( type ) ) {
		if ( parameters == null ) {
			( (ParameterizedType) type ).setParameterValues( EMPTY_PROPERTIES );
		}
		else {
			( (ParameterizedType) type ).setParameterValues( parameters );
		}
	}
	else if ( parameters != null && !parameters.isEmpty() ) {
		throw new MappingException( "type is not parameterized: " + type.getClass().getName() );
	}
}
 
Example #2
Source File: TypeFactory.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void injectParameters(Object type, Properties parameters) {
	if (type instanceof ParameterizedType) {
		( (ParameterizedType) type ).setParameterValues(parameters);
	}
	else if ( parameters!=null && !parameters.isEmpty() ) {
		throw new MappingException(
				"type is not parameterized: " +
				type.getClass().getName()
			);
	}
}