style: 更新 Table 注释。

This commit is contained in:
Suomm 2023-06-19 11:15:33 +08:00
parent 5f8ce6ab2f
commit 30a8de98b7

View File

@ -1,17 +1,17 @@
/** /*
* Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com). * Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com).
* <p> * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* <p> * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* <p> * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.mybatisflex.annotation; package com.mybatisflex.annotation;
@ -20,47 +20,51 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/**
* 数据库表信息注解
*/
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE}) @Target({ElementType.TYPE})
public @interface Table { public @interface Table {
/** /**
* 显式指定表名称 * 显式指定表名称
*/ */
String value(); String value();
/** /**
* 数据库的 schema模式 * 数据库的 schema模式
*/ */
String schema() default ""; String schema() default "";
/** /**
* 默认为 驼峰属性 转换为 下划线字段 * 默认为 驼峰属性 转换为 下划线字段
*/ */
boolean camelToUnderline() default true; boolean camelToUnderline() default true;
/** /**
* 默认使用哪个数据源若系统找不到该指定的数据源时默认使用第一个数据源 * 默认使用哪个数据源若系统找不到该指定的数据源时默认使用第一个数据源
*/ */
String dataSource() default ""; String dataSource() default "";
/** /**
* 监听 entity insert 行为 * 监听 entity insert 行为
*/ */
Class<? extends InsertListener>[] onInsert() default {}; Class<? extends InsertListener>[] onInsert() default {};
/** /**
* 监听 entity update 行为 * 监听 entity update 行为
*/ */
Class<? extends UpdateListener>[] onUpdate() default {}; Class<? extends UpdateListener>[] onUpdate() default {};
/** /**
* 监听 entity 的查询数据的 set 行为用户主动 set 不会触发 * 监听 entity 的查询数据的 set 行为用户主动 set 不会触发
*/ */
Class<? extends SetListener>[] onSet() default {}; Class<? extends SetListener>[] onSet() default {};
/** /**
* 在某些场景下我们需要手动编写 Mapper可以通过这个注解来关闭 APT Mapper 生成 * 在某些场景下我们需要手动编写 Mapper可以通过这个注解来关闭 APT Mapper 生成
*/ */
boolean mapperGenerateEnable() default true; boolean mapperGenerateEnable() default true;
} }