#1456 - io.ebean.annotation.NotNull not honored by @ManyToOne property

This commit is contained in:
rob bygrave
2018-07-18 19:36:41 +12:00
parent fda930a162
commit 2d44d06f36
4 changed files with 11 additions and 2 deletions
@@ -246,6 +246,9 @@ public class PlatformDdl {
* Convert the standard type to the platform specific type.
*/
public String convert(String type, boolean identity) {
if (type == null) {
return null;
}
if (type.contains("[]")) {
return convertArrayType(type);
}
@@ -116,6 +116,10 @@ public class AnnotationAssocOnes extends AnnotationParser {
prop.setFetchPreference(fetchPreference.value());
}
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())) {