[hibernate-dev] [Search] Regression with @ContainedIn between 4.3 and 4.4
Guillaume Smet
guillaume.smet at gmail.com
Thu Mar 27 06:35:55 EDT 2014
FWIW, we tried to work around it by adding @IndexedEmbedded(depth = 0)
but as we also have @ContainedIn on transient methods, we can't work
around it totally.
As usual we are committed to work on a test case and fix once we agree
it should be fixed.
On Thu, Mar 27, 2014 at 11:03 AM, Guillaume Smet
<guillaume.smet at hibernate.org> wrote:
> 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