MassIndexer: @IndexEmbedded, lazy field and FieldBridge problem

Description

Hello,

This is a followup of fixed a while ago by one of my colleagues (Laurent Almeras).

We have the very same problem with the Mass Indexer in the following case:
Root Entity -> @IndexEmbedded -> Entity -> @ManyToOne(fetch = FetchType.LAZY) with @FieldBridge.

The main problem is that the object should be unproxied before the injection in the field bridge code in DocumentBuilderIndexedEntity.

Once you have done that, you need to override unproxy in HibernateSessionLoadingInitializer to inject a session in the initialization.

We have a pull request ready with a test case and a patch. We'll post it once we have the patch number.

I signed a personal contributor agreement a while ago but, as this work was done on my employer time by my colleague St├ęphane Gleizes and me, I think we need to sign a corporate agreement.

Feel free to ping me on this subject.

By the way, this patch should be backpatched in 4.1.x if possible.

Environment

None

Status

Assignee

Guillaume Smet

Reporter

Guillaume Smet

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

4.2.0.Beta1
4.1.1.Final

Priority

Major