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:
Mark Paluch
2018-04-03 15:32:38 +02:00
parent 7634461997
commit 6c9b365287

View File

@@ -31,13 +31,17 @@ import org.springframework.data.annotation.Persistent;
* <pre>
* <code>
* &#64;Persistent
* &#64;Documented
* &#64;Retention(RetentionPolicy.RUNTIME)
* &#64;Target({ ElementType.TYPE })
* public &#64;interface Document {
* static @interface CacheCentricAnnotation {
*
* &#64;KeySpace
* String collection() default "person";
* &#64;AliasFor(annotation = KeySpace.class, attribute = "value")
* String cacheRegion() default "";
* }
*
* &#64;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 "";
}