From 86284b932a3ab9710aaa9db8b68e31bc8ebfd4ee Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Wed, 21 Jun 2023 22:12:14 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=B7=BB=E5=8A=A0=20TableConfig=20?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E5=B1=9E=E6=80=A7=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/config/TableConfig.java | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/TableConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/TableConfig.java index f403c11c..707d5ad5 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/TableConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/TableConfig.java @@ -1,17 +1,17 @@ -/** - * Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.mybatisflex.codegen.config; @@ -22,35 +22,51 @@ import com.mybatisflex.annotation.UpdateListener; import java.util.HashMap; import java.util.Map; +/** + * 表的单独设置。 + */ public class TableConfig { + /** + * 表名。 + */ private String tableName; /** - * 数据库的 schema(模式) + * 数据库的 schema(模式)。 */ private String schema; /** - * 默认为 驼峰属性 转换为 下划线字段 + * 默认为 驼峰属性 转换为 下划线字段。 */ private Boolean camelToUnderline; - + /** + * 监听 entity 的 insert 行为。 + */ private Class insertListenerClass; - + /** + * 监听 entity 的 update 行为。 + */ private Class updateListenerClass; - + /** + * 监听 entity 的查询数据的 set 行为。 + */ private Class setListenerClass; - + /** + * 对应列的配置。 + */ private Map columnConfigMap; + /** + * 是否开启 Mapper 生成。 + */ private Boolean mapperGenerateEnable = Boolean.TRUE; - public String getTableName() { return tableName; } @@ -126,5 +142,4 @@ public class TableConfig { return columnConfigMap == null ? null : columnConfigMap.get(columnName); } - }