Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeySpace javadoc references unsupported example [DATAKV-213] #192

Closed
spring-projects-issues opened this issue Apr 3, 2018 · 1 comment
Closed

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Apr 3, 2018

Viacheslav Petriaiev opened DATAKV-213 and commented

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


Affects: 1.2.10 (Ingalls SR10), 2.0.5 (Kay SR5)

Referenced from: commits 6c9b365, 955075c

Backported to: 2.0.6 (Kay SR6)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 3, 2018

Mark Paluch commented

Good catch, thanks a lot. We removed the support for @KeySpace on methods during the Java 8 refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants