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

Guillaume Smet guillaume.smet at gmail.com
Fri Mar 28 05:52:12 EDT 2014


Hardy,

This one is really a blocker for us as we have to put something into
production really soon with 4.4.2 and we can't do it atm. I take the
liberty to open a JIRA issue so that I can start working on a PR with
a test showing what we do and a fix.

While it looks like it was not an intented feature at the time, it's a
very useful one so it would be nice to make it work again. I don't
think it has any drawbacks to come back to the preexisting behavior.

I understand there probably won't be a release of 4.4.x soon (if any)
to fix this but, once we agree on the fix, I can deploy something on
our internal repo.

-- 
Guillaume

On Thu, Mar 27, 2014 at 2:46 PM, Guillaume Smet
<guillaume.smet at gmail.com> wrote:
> Hi Hardy,
>
> On Thu, Mar 27, 2014 at 12:52 PM, Hardy Ferentschik <hardy at hibernate.org> wrote:
>> I think an example/test would be awesome. Then we have some concrete example
>> to base our discussion upon.
>
> I don't think a test would be useful to understand what we do. Here
> are a few additional information about our business case.
>
> The fact is that we have complex business rules which requires us to
> reindex entities when we change/index one even if they don't have an
> @IndexedEmbedded relation.
>
> You're right about having specific fieldbridges but we also have the
> case when we want to index the results of a transient method on a
> dependency of the object.
>
> In one of our (many) examples of this usage, we have:
> ProductModel
>      @ContainedIn
>      Set<ProductArticle> articles;
>
> ProductArticle doesn't have an @IndexedEmbedded annotation on its
> ProductModel field because we don't use this feature to index it. But
> when we reindex a ProductModel, we need to reindex the articles.
>
> Moreover, an article might have a ShootingBrief and when we change the
> ProductModel, we also want to reindex the ShootingBriefs of the
> ProductArticles as they have a field which depends on a ProductModel
> property.
>
> This field is the result of a transient method. Not an @IndexedEmbedded thing.
>
> Using @ContainedIn as we do allows us to build a dependency graph of
> indexing. And this dependency graph exists even if we don't use
> @IndexedEmbedded but other Search features (FieldBridges, @Field on a
> transient method...).
>
> Note that it worked perfectly until 4.4.
>
> I don't know if it's more clear with these information. Feel free to
> ping me on IRC to discuss it further if needed.
>
> --
> Guillaume


More information about the hibernate-dev mailing list