[hibernate-dev] [Search] Regression with @ContainedIn between 4.3 and 4.4

Guillaume Smet guillaume.smet at hibernate.org
Thu Mar 27 06:03:27 EDT 2014


Hi,

Before 4.4, when you add a @ContainedIn to a property without the
corresponding @IndexedEmbedded, they were still added and taken into
account in the dependency resolution which was quite useful to declare
dependencies between entities without having an explicit
@IndexedEmbedded which are useless in some of our cases.

Starting with 4.4, they are simply ignored.

I've spent some time to understand why and here it is:
https://github.com/hibernate/hibernate-search/blob/4.3/engine/src/main/java/org/hibernate/search/engine/spi/AbstractDocumentBuilder.java#L686

-> you can see that the @Contained is added even if there is no
corresponding @IndexedEmbedded

In the new code, the @Contained annotation is added in
updateDepthProperties which is conditioned by the fact that there is a
corresponding @IndexedEmbedded:
https://github.com/hibernate/hibernate-search/blob/master/engine/src/main/java/org/hibernate/search/engine/metadata/impl/AnnotationMetadataProvider.java#L711
https://github.com/hibernate/hibernate-search/blob/4.3/engine/src/main/java/org/hibernate/search/engine/spi/AbstractDocumentBuilder.java#L731
https://github.com/hibernate/hibernate-search/blob/master/engine/src/main/java/org/hibernate/search/engine/metadata/impl/AnnotationMetadataProvider.java#L755

I'm wondering if it's a desired change or just an overenthusiastic refactoring?

We used the old behavior in several projects so we would really like
to see it back if it is the latter.

And if it's the former, we would like to discuss it :).

Thanks for your feedback.

-- 
Guillaume


More information about the hibernate-dev mailing list