When a indexed collection field is defined in a @MappedSuperclass, a change to this collection only will not trigger reindexing on entities extending the @MappedSuperclass.
The problems seems to lie somewhere around AbstractDocumentBuilder#collectionChangeRequiresIndexUpdate. Hibernate sets the role of a collection property defined in a mappedsuperclass as "my.package.MyConcreteEntity.myCollectionProperty", whereas the TypeMetadata#collectionRoles only contains "my.package.MyMappedSuperclass.myCollectionProperty" (regardless of the class of the actual entity), which definitely does not match.
Note that this bug only affects properties defined in a @MappedSuperclass. It does not seem to arise when the property is defined in a superclass which is an @Entity.
I am going to provide a test case soon (just need the ticket number).
|