[hibernate-dev] [Search] ParameterizedBridge API

Sanne Grinovero sanne at hibernate.org
Wed Feb 8 06:05:45 EST 2012


The current API reads:

public interface ParameterizedBridge {
	//TODO inject Properties? since the annotations cannot support Object
attribute?
	void setParameterValues(Map parameters);
}

Shall we apply the TODO, or at least change it to specify the expected
Map types?

public interface ParameterizedBridge {
	void setParameterValues(Map<String,String> parameters);
}

Using generics we would keep backwards compatibility.


I'm looking at this because we make type mistakes ourselves; for
example the example
PaddedIntegerBridge is broken:

public void setParameterValues(Map parameters) {
	Object padding = parameters.get( PADDING_PROPERTY );
	if (padding != null) this.padding = (Integer) padding;  <<<<<<< Cast exception!
}


Cheers,
Sanne



More information about the hibernate-dev mailing list