构建主键批注的方法

package gxa.bj.util;

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 PrimaryKey {

}

//给批注添加变量

public @interface PrimaryKey {

/**
* 序列名称
* @return
*/
public String seqname() default "";
}

 

//调用时候赋值方法;

@PrimaryKey(seqname="sdfsdf")

posted on 2016-06-12 23:15  看你妹儿  阅读(184)  评论(0编辑  收藏  举报

导航