Currently this mapping will fail:
{noformat} @ProjectionConstructor public record BookDTO(@IdProjection id, @ObjectProjection AuthorDTO author) {}; @ProjectionConstructor public record AuthorDTO(@IdProjection id, @FieldProjection name) {};{noformat}
… because the {{@IdProjection}} is not allowed within an object projection.
That makes sense, because {{@IdProjection}} is about the root document ID. But it’s not very intuitive.
Maybe we could extend the ID projection to allow referring to object IDs as well? |
|