Annotation Interface Indexed


Identifies a secondary index in the table on a single column.

The following columns of a Table type can be annotated with Indexed:

  • Scalar data types
  • User-defined types
  • Collection types
  • Map type

Map types distinguish allows entry, key or value-level indexing with the restriction that only a single secondary index is allowed.

 @Table
 class Person {

        Map<@Indexed String, String> indexedKey; // allows CONTAINS KEY queries
        Map<String, @Indexed String> indexedValue; // allows CONTAINS queries
 }
 
Author:
Alex Shvid, Matthew T. Adams, Mark Paluch
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the index.
  • Element Details

    • value

      String value
      The name of the index. If null or empty, then the index name will be generated by Cassandra and will be unknown unless column metadata is used to discover the generated index name.
      Default:
      ""