Purging a document from the POJO mapper will lead to NPE

Description

org.hibernate.search.mapper.pojo.work.impl.PojoIndexedTypeIndexingPlan.IndexedEntityIndexingPlan#purge sets entitySupplier to null:

But then the actual execution of the purge will try to retrieve the routing key, which will involve dereferencing the entitySupplier.
For example org.hibernate.search.backend.lucene.work.execution.impl.LuceneIndexIndexingPlan#delete:

Two problems to solve:

1. When the user doesn't use routing key, this should work fine and not throw an NPE. => Actually this already works fine: we don't try to dereference the entitySupplier in that case.
2. When the user does use routing key, we should expect users to provide the routing key to org.hibernate.search.mapper.orm.work.SearchIndexingPlan#purge(java.lang.Class<?>, java.lang.Object)/org.hibernate.search.mapper.orm.work.SearchIndexingPlan#purge(java.lang.String, java.lang.Object). Let's just add a String parameter.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Fix versions

Priority

Major
Configure