Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2.10 (Ingalls SR10), 2.0.5 (Kay SR5)
-
Fix Version/s: 2.1 M2 (Lovelace), 2.0.6 (Kay SR6)
-
Component/s: Documentation
-
Labels:None
-
Sprint:Lovelace M2 / M3
Description
Class org.springframework.data.keyvalue.annotation.KeySpace has outdated and unsupported javadoc example
Marker interface for methods with Persistent annotations indicating the presence of a dedicated keyspace the entity should reside in. If present the value will be picked up for resolving the keyspace.
@Persistent @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) public @interface Document { @KeySpace String collection() default "person"; }
this one should be replaced with
2.3.1. Custom KeySpace Annotation
It is possible to compose own KeySpace annotations for a more domain centric usage by annotating one of the attributes with @AliasFor.
The composed annotation needs to inherit @Persistent.
@Keyspace @Persistent @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) static @interface CacheCentricAnnotation { @AliasFor(annotation = KeySpace.class, attribute = "value") String cacheRegion() default ""; } @CacheCentricAnnotation(cacheRegion = "customers") class Customer { //... }
accordingly to reference documentation