mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-08 16:40:20 +00:00
NEW: flag to control, if javax.validation NotNull annotation should generate a NotNull column or not (#1306)
This commit is contained in:
1 parent
94a118d635
commit
18ca3403ac
3 files changed
+39
No files matched your search
@@ -97,6 +97,9 @@ public abstract class AnnotationParser extends AnnotationBase {
|
||||
* can be applied to DDL generation.
|
||||
*/
|
||||
protected boolean isEbeanValidationGroups(Class<?>[] groups) {
|
||||
if (!util.isUseJavaxValidationNotNull()) {
|
||||
return false;
|
||||
}
|
||||
if (groups.length == 0
|
||||
|| groups.length == 1 && javax.validation.groups.Default.class.isAssignableFrom(groups[0])) {
|
||||
return true;
|
||||
|
||||
@@ -60,6 +60,8 @@ public class DeployUtil {
|
||||
|
||||
private final Encryptor bytesEncryptor;
|
||||
|
||||
private final boolean useJavaxValidationNotNull;
|
||||
|
||||
public DeployUtil(TypeManager typeMgr, ServerConfig serverConfig) {
|
||||
|
||||
this.typeManager = typeMgr;
|
||||
@@ -70,6 +72,7 @@ public class DeployUtil {
|
||||
|
||||
Encryptor be = serverConfig.getEncryptor();
|
||||
this.bytesEncryptor = be != null ? be : new SimpleAesEncryptor();
|
||||
this.useJavaxValidationNotNull = serverConfig.isUseJavaxValidationNotNull();
|
||||
}
|
||||
|
||||
public TypeManager getTypeManager() {
|
||||
@@ -294,4 +297,7 @@ public class DeployUtil {
|
||||
return type.equals(String.class);
|
||||
}
|
||||
|
||||
public boolean isUseJavaxValidationNotNull() {
|
||||
return useJavaxValidationNotNull;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user