Follow-up on HSEARCH-3438. We may want to do it before the release because it would impact the {{ContainerExtractorPath}} mapping API.
The idea would be to allow Currently users to can write this:
{code} @GenericField(extractors = { @ContainerExtractor(type = MyContainerExtractor1.class), @ContainerExtractor(BuiltinContainerExtractors.AUTOMATIC), @ContainerExtractor(type = MyContainerExtractor2.class) }) {code}
Currently And it kind of makes sense, but it will fail at bootstrap, because {{AUTOMATIC}} can only be used if there is only one extractor , but that's more an .
We should improve the consistency between the API issue than and the implementation: either we expose an API that does not even allow to express such things, or we change the implementation issue to support such things .
See <TODO conversation link> for details ## Solution 1: improve implementation
It shouldn't be too hard to support; the lower levels are probably ready, the main problem would be to modify {{ContainerExtractorPath}} to allow to represent the information (currently the whole path must represent "default extractors" (= automatic resolution), you can't model an automatic resolution mixed with explicit extractors .
Also see However:
# It's really not clear what the TODO use case for such an extractor chain would be. Why would you mention a few extractors explicitly, but use automatic resolution for the others? # We would still have some inconsistency in the APIs: sometimes a {{ org @ContainerValue}} annotation would refer to one extractor (explicit reference) sometimes it would refer to zero, one or multiple extractors (automatic resolution)
## Solution 2: restrict API
We could move up one level the place where automatic resolution is set, i . hibernate e . search :
{code} @GenericField( extractorsResolvedFromType = false, extractors = { @ContainerExtractor(type = MyContainerExtractor1 . mapper class), @ContainerExtractor(type = MyContainerExtractor2 . pojo class) } ) {code}
or:
{code} @GenericField(extraction = @ContainerExtraction( resolveFromType = false, value = { @ContainerExtractor(type = MyContainerExtractor1 . mapping class), @ContainerExtractor(type = MyContainerExtractor2 . definition class) } )) {code}
. annotation . impl . AnnotationProcessorHelper but that's awfully verbose.
# getExtractorPath}} # Other solutions?
I'd like other solutions, because the two above are not very satisfying . |
|