DATAKV-213 - Update usage example for composed annotations using KeySpace.
We now mention an example using AliasFor that is used via AnnotatedElementUtils.findMergedAnnotation(…) to retrieve the keyspace value.
This commit is contained in:
@@ -31,13 +31,17 @@ import org.springframework.data.annotation.Persistent;
|
||||
* <pre>
|
||||
* <code>
|
||||
* @Persistent
|
||||
* @Documented
|
||||
* @Retention(RetentionPolicy.RUNTIME)
|
||||
* @Target({ ElementType.TYPE })
|
||||
* public @interface Document {
|
||||
* static @interface CacheCentricAnnotation {
|
||||
*
|
||||
* @KeySpace
|
||||
* String collection() default "person";
|
||||
* @AliasFor(annotation = KeySpace.class, attribute = "value")
|
||||
* String cacheRegion() default "";
|
||||
* }
|
||||
*
|
||||
* @CacheCentricAnnotation(cacheRegion = "customers")
|
||||
* class Customer {
|
||||
* //...
|
||||
* }
|
||||
* </code>
|
||||
* </pre>
|
||||
@@ -54,11 +58,15 @@ import org.springframework.data.annotation.Persistent;
|
||||
* </pre>
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(value = { METHOD, TYPE })
|
||||
public @interface KeySpace {
|
||||
|
||||
/**
|
||||
* @return dedicated keyspace the entity should reside in.
|
||||
*/
|
||||
String value() default "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user