DATAJDBC-374 - Introduce shortcuts for Embedded#onEmpty(…)

@Embedded.Nullable & @Embedded.Empty offer shortcuts for @Embedded(onEmpty = USE_NULL) and @Embedded(onEmpty = USE_EMPTY) to reduce verbositility and simultaneously set JSR-305 @javax.annotation.Nonnull accordingly.

    @Embedded.Nullable
    EmbeddedEntity embeddedEntity;

Original pull request: #154.
This commit is contained in:
Christoph Strobl
2019-05-22 10:09:32 +02:00
committed by Jens Schauder
parent 5830b83cf4
commit 55a3f9c372
5 changed files with 114 additions and 2 deletions

View File

@@ -558,13 +558,13 @@ public class EntityRowMapperUnitTests {
static class WithEmptyEmbeddedImmutableValue {
@Id Long id;
@Embedded(onEmpty = OnEmpty.USE_EMPTY) ImmutableValue embeddedImmutableValue;
@Embedded.Empty ImmutableValue embeddedImmutableValue;
}
static class WithEmbeddedPrimitiveImmutableValue {
@Id Long id;
@Embedded(onEmpty = OnEmpty.USE_NULL) ImmutablePrimitiveValue embeddedImmutablePrimitiveValue;
@Embedded.Nullable ImmutablePrimitiveValue embeddedImmutablePrimitiveValue;
}
@Value