All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.quickdao.annotation.ForeignKey Maven / Gradle / Ivy

There is a newer version: 5.3.1
Show newest version
package cn.schoolwow.quickdao.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ForeignKey {
    /**
     * 关联到哪张表
     */
    Class table();

    /**
     * 关联到哪个字段
     */
    String field() default "id";

    /**
     * 外键记录被更新的操作
     */
    ForeignKeyOption updateForeignKeyOption() default ForeignKeyOption.CASCADE;

    /**
     * 外键记录被删除时的操作
     */
    ForeignKeyOption deleteForeignKeyOption() default ForeignKeyOption.NOACTION;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy