com.gitee.sunchenbin.mybatis.actable.annotation.Unique Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-enhance-actable Show documentation
Show all versions of mybatis-enhance-actable Show documentation
A.CTable is a Maven project based on Spring and Mybatis, which enhances the function of Mybatis
package com.gitee.sunchenbin.mybatis.actable.annotation;
import org.springframework.core.annotation.AliasFor;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 设置字段唯一约束
*
* @author sunchenbin
* @version 2019年6月14日 下午6:12:48
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Unique {
/**
* 唯一约束的名字,不设置默认为{actable_uni_当前标记字段名@Column的name}
* 如果设置了名字例如union_name,系统会默认在名字前加actable_uni_前缀,也就是actable_uni_union_name
* @return
*/
public String value() default "";
/**
* 唯一约束的字段名,不设置默认为当前标记字段名@Column的name
*
可设置多个建立联合唯一{"login_mobile","login_name"}
* @return
*/
public String[] columns() default {};
}