#615 - ENH: Change DDL generation with @SoftDelete to add 'default false' to column definition

This commit is contained in:
Robin Bygrave
2016-03-23 11:10:35 +13:00
parent 90ee903c52
commit 7d89b97e2b
28 changed files with 212 additions and 60 deletions
@@ -11,6 +11,7 @@ import com.avaje.ebean.annotation.WhenModified;
import com.avaje.ebean.annotation.WhoCreated;
import com.avaje.ebean.annotation.WhoModified;
import com.avaje.ebean.config.ScalarTypeConverter;
import com.avaje.ebean.config.dbplatform.DbDefaultValue;
import com.avaje.ebean.config.dbplatform.DbEncrypt;
import com.avaje.ebean.config.dbplatform.DbEncryptFunction;
import com.avaje.ebeaninternal.server.core.InternString;
@@ -202,6 +203,8 @@ public class DeployBeanProperty {
private String dbComment;
private String dbColumnDefault;
public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, ScalarType<?> scalarType, ScalarTypeConverter<?, ?> typeConverter) {
this.desc = desc;
this.propertyType = propertyType;
@@ -902,6 +905,7 @@ public class DeployBeanProperty {
public void setSoftDelete() {
this.softDelete = true;
this.nullable = false;
this.dbColumnDefault = DbDefaultValue.FALSE;
}
public boolean isSoftDelete() {
@@ -932,4 +936,7 @@ public class DeployBeanProperty {
return docMapping.create();
}
public String getDbColumnDefault() {
return dbColumnDefault;
}
}