I'm now very happy with how the use of jakarta.annotation.Nullable and jakarta.annotation.Nonnull has turned out in the persistence spec, and I think we should do something similar here. That is:
- annotate methods and method parameters of Jakarta Data APIs with
@Nullable or @Nonnull as appropriate, and even
- encourage the developer to annotate repository methods and their parameters with these annotations, allowing the repository implementation to make use of the additional information (we already support this in Hibernate).
There's no real downside to any of this that I can see.
I'm now very happy with how the use of
jakarta.annotation.Nullableandjakarta.annotation.Nonnullhas turned out in the persistence spec, and I think we should do something similar here. That is:@Nullableor@Nonnullas appropriate, and evenThere's no real downside to any of this that I can see.