[hibernate-dev] [Search] ParameterizedBridge API

Sanne Grinovero sanne at hibernate.org
Fri Feb 10 08:13:19 EST 2012


On 10 February 2012 13:06, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> I would not want Properties but Map<String,String> might be ok.
>
> Make sure that built-in types do not pass actual objects from the bridge factory though.

That's what we thought as well :

https://hibernate.onjira.com/browse/HSEARCH-1042
https://github.com/hibernate/hibernate-search/commit/1652c9d0dd3dfa6db00f6ea39028259fec98db4b
https://github.com/hibernate/hibernate-search/commit/9efc1e2c4de3279ff2c15a8f5743e5b8b4f2a1f5

;-)

>
> On 8 févr. 2012, at 12:05, Sanne Grinovero wrote:
>
>> 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
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>




More information about the hibernate-dev mailing list