#947 - Treat primitive boolean as NOT NULL - DDL as not null

This commit is contained in:
Rob Bygrave
2017-04-25 13:17:58 +12:00
parent 43408fcb87
commit a120c2aaee
2 changed files with 11 additions and 1 deletions
@@ -933,6 +933,16 @@ public class DeployBeanProperty {
return draftReset;
}
/**
* Primitive boolean check so see if not null default false should be applied.
*/
public void checkPrimitiveBoolean() {
if (boolean.class.equals(propertyType) && !softDelete) {
this.nullable = false;
this.dbColumnDefault = DbDefaultValue.FALSE;
}
}
public void setSoftDelete() {
this.softDelete = true;
this.nullable = false;
@@ -179,9 +179,9 @@ public class DeployUtil {
ScalarType<?> scalarType = getScalarType(property);
if (scalarType != null) {
// set the jdbc type this maps to
property.setDbType(scalarType.getJdbcType());
property.setScalarType(scalarType);
property.checkPrimitiveBoolean();
}
}