|
|
@@ -18,10 +18,11 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { |
|
|
|
private final static String tableNameKey = "_def_table_name"; |
|
|
|
private final static String statusKey = "_status"; |
|
|
|
|
|
|
|
public DefaultEntity() {} |
|
|
|
public DefaultEntity() { |
|
|
|
} |
|
|
|
|
|
|
|
public DefaultEntity(String _def_table_name) { |
|
|
|
this.put(tableNameKey,_def_table_name); |
|
|
|
this.put(tableNameKey, _def_table_name); |
|
|
|
} |
|
|
|
|
|
|
|
public ModelTable getModelTable() { |
|
|
@@ -31,6 +32,7 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { |
|
|
|
public String getTableName() { |
|
|
|
return getStr(tableNameKey); |
|
|
|
} |
|
|
|
|
|
|
|
public void setTableName(String tableName) { |
|
|
|
put(tableNameKey, tableName); |
|
|
|
} |
|
|
@@ -59,12 +61,16 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { |
|
|
|
put(field.getName(), DateUtil.nowDateTimeLong()); |
|
|
|
} else { |
|
|
|
String s = field.getDefaultValue(); |
|
|
|
if (StringUtils.isNotEmpty(s)) put(field.getName(), s); |
|
|
|
if (StringUtils.isNotEmpty(s)) { |
|
|
|
put(field.getName(), SwEnum.DataType.getDataValue(field.getDataType(), s)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 主键字段 */ |
|
|
|
/** |
|
|
|
* 主键字段 |
|
|
|
*/ |
|
|
|
public String getPkFieldName() { |
|
|
|
return getModelTable().getIdField(); |
|
|
|
} |
|
|
|