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

## Class PersistenceController

- java.lang.Object
- - org.apache.ignite.cache.store.cassandra.persistence.PersistenceController

-     public class PersistenceController
      extends Object

  Intermediate layer between persistent store (Cassandra) and Ignite cache key/value classes. Handles all the mappings to/from Java classes into Cassandra and responsible for all the details of how Java objects should be written/loaded to/from Cassandra.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PersistenceController(KeyValuePersistenceSettings settings)` Constructs persistence controller from Ignite cache persistence settings.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.datastax.driver.core.BoundStatement` | `bindKey(com.datastax.driver.core.PreparedStatement statement, Object key)` Binds Ignite cache key object to `PreparedStatement`.
    `com.datastax.driver.core.BoundStatement` | `bindKeyValue(com.datastax.driver.core.PreparedStatement statement, Object key, Object val)` Binds Ignite cache key and value object to `PreparedStatement`.
    `Object` | `buildKeyObject(com.datastax.driver.core.Row row)` Builds Ignite cache key object from returned Cassandra table row.
    `Object` | `buildValueObject(com.datastax.driver.core.Row row)` Builds Ignite cache value object from Cassandra table row .
    `String` | `getDeleteStatement(String table)` Returns CQL statement to delete row from Cassandra table.
    `String` | `getLoadStatement(String table, boolean includeKeyFields)` Returns CQL statement to select key/value fields from Cassandra table.
    `KeyValuePersistenceSettings` | `getPersistenceSettings()` Returns Ignite cache persistence settings.
    `String` | `getWriteStatement(String table)` Returns CQL statement to insert row into Cassandra table.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PersistenceController

          public PersistenceController(KeyValuePersistenceSettings settings)

      Constructs persistence controller from Ignite cache persistence settings.
      Parameters:
        `settings` - persistence settings.

  - ### Method Detail

    - #### getPersistenceSettings

          public KeyValuePersistenceSettings getPersistenceSettings()

      Returns Ignite cache persistence settings.
      Returns:
        persistence settings.

    - #### getWriteStatement

          public String getWriteStatement(String table)

      Returns CQL statement to insert row into Cassandra table.
      Parameters:
        `table` - Table name.
      Returns:
        CQL statement.

    - #### getDeleteStatement

          public String getDeleteStatement(String table)

      Returns CQL statement to delete row from Cassandra table.
      Parameters:
        `table` - Table name.
      Returns:
        CQL statement.

    - #### getLoadStatement

          public String getLoadStatement(String table,
                                         boolean includeKeyFields)

      Returns CQL statement to select key/value fields from Cassandra table.
      Parameters:
        `table` - Table name.
        `includeKeyFields` - whether to include/exclude key fields from the returned row.
      Returns:
        CQL statement.

    - #### bindKey

          public com.datastax.driver.core.BoundStatement bindKey(com.datastax.driver.core.PreparedStatement statement,
                                                                 Object key)

      Binds Ignite cache key object to `PreparedStatement`.
      Parameters:
        `statement` - statement to which key object should be bind.
        `key` - key object.
      Returns:
        statement with bounded key.

    - #### bindKeyValue

          public com.datastax.driver.core.BoundStatement bindKeyValue(com.datastax.driver.core.PreparedStatement statement,
                                                                      Object key,
                                                                      Object val)

      Binds Ignite cache key and value object to `PreparedStatement`.
      Parameters:
        `statement` - statement to which key and value object should be bind.
        `key` - key object.
        `val` - value object.
      Returns:
        statement with bounded key and value.

    - #### buildKeyObject

          public Object buildKeyObject(com.datastax.driver.core.Row row)

      Builds Ignite cache key object from returned Cassandra table row.
      Parameters:
        `row` - Cassandra table row.
      Returns:
        key object.

    - #### buildValueObject

          public Object buildValueObject(com.datastax.driver.core.Row row)

      Builds Ignite cache value object from Cassandra table row .
      Parameters:
        `row` - Cassandra table row.
      Returns:
        value object.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020