com.hammurapi.store

## Interface BackingStore<T,PK>

-     public interface BackingStore<T,PK>

  Backing store can be used by object store to load and store objects. In this case the object store role is manipulation and backing store role is persistence.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(PK primaryKey, T obj)` Adds object to the backing store.
    `Iterable<T>` | `load()`
    `T` | `load(PK primaryKey)` This method is invoked only if the object store getByPrimaryKey() is invoked and the primary key is not present in the object store.
    `void` | `remove(PK primaryKey, T obj)` Removes object from the backing store.
    `void` | `update(PK primaryKey, T obj)` Updates object in the backing store.

- - ### Method Detail

    - #### load

          Iterable<T> load()

      Returns:
        Iterable to load objects to the object store.

    - #### load

          T load(PK primaryKey)

      This method is invoked only if the object store getByPrimaryKey() is invoked and the primary key is not present in the object store. This method can be used if the object store is used as a memory sensitive cache.
      Parameters:
        `primaryKey` -
      Returns:

    - #### add

          void add(PK primaryKey,
                 T obj)

      Adds object to the backing store.
      Parameters:
        `primaryKey` - Primary key value, if object store is configured with primary key extractor, null otherwise.
        `obj` - Object to store.

    - #### remove

          void remove(PK primaryKey,
                    T obj)

      Removes object from the backing store.
      Parameters:
        `primaryKey` - Primary key value, if object store is configured with primary key extractor, null otherwise.
        `obj` - Object to remove.

    - #### update

          void update(PK primaryKey,
                    T obj)

      Updates object in the backing store.
      Parameters:
        `primaryKey` - Primary key value, if object store is configured with primary key extractor, null otherwise.
        `obj` - Object to update.