From 7609ead91ce1cb1e97eb05fd99c6eff3606aa215 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Tue, 2 Apr 2024 10:53:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20`@ViewObject`=20?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=A0=87=E8=AE=B0=20VO=20=E7=B1=BB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisflex/annotation/ViewObject.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/ViewObject.java diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/ViewObject.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/ViewObject.java new file mode 100644 index 00000000..d258b144 --- /dev/null +++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/ViewObject.java @@ -0,0 +1,48 @@ +/* + * 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.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * VO(View Object)类。 + * + * @author 王帅 + * @since 2024-04-02 + */ +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ViewObject { + + /** + * 对应的 实体类 引用。 + * + * @return 实体类引用 + */ + Class> ref(); + + /** + * 是否复制引用类 {@code @Table} 注解上的内容,默认为:{@code true}。 + * + * @return 是否复制属性 + */ + boolean copyTableProps() default true; + +}