mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#947 - Treat primitive boolean as NOT NULL - DDL as not null
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user