[hibernate-dev] Indexing IDs of IndexedEmbedded components
Emmanuel Bernard
emmanuel at hibernate.org
Wed Feb 22 05:05:51 EST 2012
I am not sure @DocumentId is the right place to host it. Should it be rather on the embedding entity to be able to customize in which scenario id is indexed? In a way, includePath="city.id" is the indicator I am looking for.
On 16 févr. 2012, at 11:54, Sanne Grinovero wrote:
> This is related to HSEARCH-1049: it seems that the new includePaths
> feature is not accepting paths including the id of embedded objects,
> as in:
>
> @IndexedEmbedded(prefix="location.",includePaths={"city.id","city.city","country.id","city.region.id"})
> public Address getAddress() { return address; }
>
> As the "id" is a special field.
>
> On the other hand, I remember people on forums [1] asking how to
> *avoid* having to include the ids of embedded objects stored in the
> index; I agree that often that's not needed, in fact I wasn't even
> expecting it.
>
> This seems to have been introduced by HSEARCH-108 - but it's not
> possible to "turn it off".
>
> What about having
>
> @DocumentId( name = "id", includeEmbedded = true )
> @ProvidedId( name = "id", includeEmbedded = true )
> ?
>
> This would default to _true_ (also when no @DocumentId/Provided is
> explicitly defined).
>
> Getting back to the issue about
> @IndexedEmbedded(includePaths={"city.id"}), the validation should be
> accepted only when it's included in it's embedded form.
>
> [1] - sorry can't find the references - in addition to other users
> this affected myself as well in the past.
> _______________________________________________
> 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