org.apache.ignite.cache.store.cassandra.persistence

## Enum PersistenceStrategy

- java.lang.Object
- - java.lang.Enum<PersistenceStrategy>
  - - org.apache.ignite.cache.store.cassandra.persistence.PersistenceStrategy

- All Implemented Interfaces:
    Serializable, Comparable<PersistenceStrategy>

      public enum PersistenceStrategy
      extends Enum<PersistenceStrategy>

  Describes persistence strategy to be used to persist object data into Cassandra.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BLOB` Stores object value as BLOB, by mapping its value to Cassandra table column with blob type.
    `POJO` Stores each field of an object as a column having corresponding type in Cassandra table.
    `PRIMITIVE` Stores object value as is, by mapping its value to Cassandra table column with corresponding type.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PersistenceStrategy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static PersistenceStrategy[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### PRIMITIVE

          public static final PersistenceStrategy PRIMITIVE

      Stores object value as is, by mapping its value to Cassandra table column with corresponding type.

      Could be used for primitive java type (like Integer, String, Long and etc) which could be directly mapped to appropriate Cassandra types.

    - #### BLOB

          public static final PersistenceStrategy BLOB

      Stores object value as BLOB, by mapping its value to Cassandra table column with blob type. Could be used for any java type. Conversion of java object to BLOB is handled by specified serializer.

      Available serializer implementations:

      - org.apache.ignite.cache.store.cassandra.serializer.JavaSerializer - uses standard Java serialization framework.
      - org.apache.ignite.cache.store.cassandra.serializer.KryoSerializer - uses Kryo serialization framework.

    - #### POJO

          public static final PersistenceStrategy POJO

      Stores each field of an object as a column having corresponding type in Cassandra table. Provides ability to utilize Cassandra secondary indexes for object fields.

      Could be used for objects which follow JavaBeans convention and having empty public constructor. Object fields should be:

      - Primitive java types like int, long, String and etc.
      - Collections of primitive java types like List, Map, Set

  - ### Method Detail

    - #### values

          public static PersistenceStrategy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (PersistenceStrategy c : PersistenceStrategy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static PersistenceStrategy valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022