2023-07-12 10:24:10 +08:00

66 lines
1.5 KiB
Java

/*
* Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.*;
/**
* 一对多映射。
*
* @author michael
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface RelationOneToMany {
/**
* 当前实体类的属性。
*
* @return 属性名称
*/
String selfField() default "";
/**
* 目标实体类的关联属性。
*
* @return 属性名称
*/
String targetField();
/**
* 查询排序。
*
* @return 排序方式
*/
String orderBy() default "";
/**
* 现在查询的数据量。
*
* @return 数据量
*/
int limit() default 0;
/**
* 默认使用哪个数据源,若系统找不到该指定的数据源时,默认使用第一个数据源。
*
* @return 数据源
*/
String dataSource() default "";
}