Uploaded image for project: 'Spring Data KeyValue'
  1. Spring Data KeyValue
  2. DATAKV-213

KeySpace javadoc references unsupported example

    XMLWordPrintable

    Details

    • 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

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            vpetriaiev Viacheslav Petriaiev
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: