[hibernate-dev] [HSEARCH-566] Indexing null values for an @ElementCollection

Sanne Grinovero sanne at hibernate.org
Mon Aug 1 04:31:33 EDT 2011


2011/8/1 Emmanuel Bernard <emmanuel at hibernate.org>:
>
> On 31 juil. 2011, at 21:44, Sanne Grinovero wrote:
>
>> @ElementCollection
>> @Field(indexNullAsl="nullToken")
>> String[] tags
>
> Hum is it really the way we are going? ie @Field would be used by the elements of the collection if it's a collection?
>
> I'm not a big fan for a couple of reasons:
>
> - it breaks backward compatibility
> - I cannot write a custom collection bridge

How is this breaking backwards compatibility, when this was previously
not supported? This was needing a field bridge, and since I've been
suggesting many times on the forum how to add multiple fields, it
seems a common use case.

I think this new bridge could be applied to the elements in this case,
but be overridden by a custom bridge: so if someone was defining his
own custom bridge it would still be applied instead.
The point of the feature is that when mapping collections of
primitives, people don't need to provide a custom bridge, and @Field
is all what is needed to index the elements; of course this should not
prevent more advanced mappings.



More information about the hibernate-dev mailing list