DATAKV-129 - Allow usage of @AliasFor with @KeySpace.
We now allow using Spring's meta-annotation programming model. Own meta-annotations can be composed using @KeySpace and @AliasFor annotation.
Example for a custom meta-annotation corresponding to @KeySpace("sessions") when it's used with @SessionsKeyspace class MyEntity {…}:
@Persistent
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
@KeySpace
public @interface SessionsKeyspace {
@AliasFor(annotation = KeySpace.class, attribute = "value")
String name() default "sessions";
}
Original pull request: #19.
This commit is contained in:
committed by
Mark Paluch
parent
2cce00f1fe
commit
070be6e47d
@@ -59,7 +59,7 @@ enum AnnotationBasedKeySpaceResolver implements KeySpaceResolver {
|
||||
|
||||
private static Object getKeySpace(Class<?> type) {
|
||||
|
||||
KeySpace keyspace = AnnotationUtils.findAnnotation(type, KeySpace.class);
|
||||
KeySpace keyspace = AnnotatedElementUtils.findMergedAnnotation(type, KeySpace.class);
|
||||
|
||||
if (keyspace != null) {
|
||||
return AnnotationUtils.getValue(keyspace);
|
||||
|
||||
Reference in New Issue
Block a user