mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#615 - ENH: Change DDL generation with @SoftDelete to add 'default false' to column definition
This commit is contained in:
1 parent
90ee903c52
commit
7d89b97e2b
28 files changed
+212
-60
No files matched your search
@@ -219,6 +219,11 @@ public class BeanProperty implements ElPropertyValue, Property {
|
||||
*/
|
||||
final String dbColumnDefn;
|
||||
|
||||
/**
|
||||
* DB Column default value for DDL definition (FALSE, NOW etc).
|
||||
*/
|
||||
final String dbColumnDefault;
|
||||
|
||||
/**
|
||||
* Database DDL column comment.
|
||||
*/
|
||||
@@ -298,6 +303,7 @@ public class BeanProperty implements ElPropertyValue, Property {
|
||||
this.dbScale = deploy.getDbScale();
|
||||
this.dbColumnDefn = InternString.intern(deploy.getDbColumnDefn());
|
||||
this.dbConstraintExpression = InternString.intern(deploy.getDbConstraintExpression());
|
||||
this.dbColumnDefault = deploy.getDbColumnDefault();
|
||||
|
||||
this.inherited = false;// deploy.isInherited();
|
||||
this.owningType = deploy.getOwningType();
|
||||
@@ -407,6 +413,7 @@ public class BeanProperty implements ElPropertyValue, Property {
|
||||
this.dbScale = source.getDbScale();
|
||||
this.dbColumnDefn = InternString.intern(source.getDbColumnDefn());
|
||||
this.dbConstraintExpression = InternString.intern(source.getDbConstraintExpression());
|
||||
this.dbColumnDefault = source.dbColumnDefault;
|
||||
|
||||
this.inherited = source.isInherited();
|
||||
this.owningType = source.owningType;
|
||||
@@ -945,6 +952,13 @@ public class BeanProperty implements ElPropertyValue, Property {
|
||||
return dbType.renderType(dbLength, dbScale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the DB column default to use for DDL.
|
||||
*/
|
||||
public String getDbColumnDefault() {
|
||||
return dbColumnDefn != null ? null : dbColumnDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the bean Field associated with this property.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user