From e964b6f1448139da82229b88a62a3f20157cd677 Mon Sep 17 00:00:00 2001 From: yayun Date: Fri, 16 Apr 2021 11:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=88=97=E5=8A=A0=E5=85=A5=E5=88=97?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/hutool/db/meta/Column.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hutool-db/src/main/java/cn/hutool/db/meta/Column.java b/hutool-db/src/main/java/cn/hutool/db/meta/Column.java index f2466d066..67f8cfea2 100644 --- a/hutool-db/src/main/java/cn/hutool/db/meta/Column.java +++ b/hutool-db/src/main/java/cn/hutool/db/meta/Column.java @@ -51,6 +51,11 @@ public class Column implements Serializable, Cloneable { * 是否自增 */ private boolean autoIncrement; + + /** + * default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) + */ + private String columnDef; /** * 是否为主键 */ @@ -153,6 +158,7 @@ public class Column implements Serializable, Cloneable { this.size = columnMetaRs.getInt("COLUMN_SIZE"); this.isNullable = columnMetaRs.getBoolean("NULLABLE"); this.comment = columnMetaRs.getString("REMARKS"); + this.columnDef = columnMetaRs.getString("COLUMN_DEF"); // 保留小数位数 try { @@ -387,6 +393,26 @@ public class Column implements Serializable, Cloneable { this.isPk = isPk; return this; } + /** + * 获取默认值 + * + * @return 默认值 + */ + public String getColumnDef() { + return columnDef; + } + + /** + * 设置默认值 + * + * @param columnDef 默认值 + * @return this + */ + public Column setColumnDef(String columnDef) { + this.columnDef = columnDef; + return this; + } + // ----------------------------------------------------- Getters and Setters end @Override