#1001 - Add @Length and @NotNull, (plus move @Transactional to ebean-annotation)

This commit is contained in:
Rob Bygrave
2017-03-31 21:56:30 +13:00
parent 1778afa17d
commit 964d2d00a2
4 changed files with 5 additions and 144 deletions
@@ -91,7 +91,6 @@ public class AnnotationFields extends AnnotationParser {
boolean javaxValidationAnnotations, boolean jacksonAnnotationsPresent, boolean eagerFetchLobs) {
super(info, javaxValidationAnnotations);
this.jacksonAnnotationsPresent = jacksonAnnotationsPresent;
this.generatedPropFactory = generatedPropFactory;
@@ -317,6 +316,10 @@ public class AnnotationFields extends AnnotationParser {
prop.setExcludedFromHistory();
}
io.ebean.annotation.NotNull nonNull = get(prop, io.ebean.annotation.NotNull.class);
if (nonNull != null) {
prop.setNullable(false);
}
if (validationAnnotations) {
NotNull notNull = get(prop, NotNull.class);
if (notNull != null && isEbeanValidationGroups(notNull.groups())) {