Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
enum 으로 DataSource 별 Type을 셋팅한다.
package kr.sidnancy.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface DataSource {
kr.sidnancy.common.type.DataSourceType value() default kr.sidnancy.common.type.DataSourceType.SLAVE;
}
package kr.sidnancy.common.type;
public enum DataSourceType {
MASTER,SLAVE,DIST_READ,DIST_WRITE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment