Better guidance for misconfigured or unconfigured projection/loading in Standalone pojo mapper

Description

We need a better error message for misconfigured or unconfigured projection/loading in Standalone pojo mapper.

This one seems obsolete:

org.hibernate.search.util.common.SearchException: HSEARCH000614: Cannot project on entity type 'MetadataSearch': this type cannot be loaded from an external datasource, and the documents from the index cannot be projected to its Java class 'MetadataSearch'. To enable loading of entity instances from an external source, provide a SelectionLoadingStrategy when registering the entity type to the mapping builder. To enable projections turning taking index data into entity instances, annotate a constructor of the entity type with @ProjectionConstructor.See the reference documentation for more information.

In particular:

  • We should probably mention projection constructors first, as they're easier to deal with

  • I'm not sure "when registering the entity type to the mapping builder" still makes sense. People don't have to deal with the "mapping builder" for this nowadays.

We might even want to provide direct links to the documentation… but that’s a bigger task:

See also https://hibernate.zulipchat.com/#narrow/stream/132092-hibernate-search-dev/topic/Guidance.20for.20Standalone.20pojo.20mapper

Activity

Details

Assignee

Reporter

Priority

Created June 28, 2024 at 7:42 AM
Updated June 28, 2024 at 7:45 AM