style: 更新 Id 注释。

This commit is contained in:
Suomm 2023-06-19 11:13:08 +08:00
parent 65ca516efb
commit 0e38416481

View File

@ -1,50 +1,53 @@
/** /*
* 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;
import java.lang.annotation.*; import java.lang.annotation.*;
/**
* 数据库表中的列信息注解
*/
@Inherited @Inherited
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD}) @Target({ElementType.FIELD})
public @interface Id { public @interface Id {
/** /**
* ID 生成策略默认为 none * ID 生成策略默认为 {@link KeyType#None}
* *
* @return 生成策略 * @return 生成策略
*/ */
KeyType keyType() default KeyType.None; KeyType keyType() default KeyType.None;
/** /**
* keyType 类型是 sequence value 则代表的是 * <p> keyType 类型是 sequence value 则代表的是
* sequence 序列的 sql 内容 * sequence 序列的 sql 内容
* 例如select SEQ_USER_ID.nextval as id from dual * 例如select SEQ_USER_ID.nextval as id from dual
* *
* keyType Generatorvalue 则代表的是使用的那个 keyGenerator 的名称 * <p> keyType Generatorvalue 则代表的是使用的那个 keyGenerator 的名称
*
*/ */
String value() default ""; String value() default "";
/** /**
* sequence 序列执行顺序 * <p>sequence 序列执行顺序
* 是在 entity 数据插入之前执行还是之后执行之后执行的一般是数据主动生成的 id *
* <p>是在 entity 数据插入之前执行还是之后执行之后执行的一般是数据主动生成的 id
* *
* @return 执行之前还是之后 * @return 执行之前还是之后
*/ */
boolean before() default true; boolean before() default true;
} }