org.apache.ignite.springdata.repository.support

## Class IgniteRepositoryImpl<T,ID extends Serializable>

- java.lang.Object
- - org.apache.ignite.springdata.repository.support.IgniteRepositoryImpl<T,ID>

- All Implemented Interfaces:
    IgniteRepository<T,ID>, org.springframework.data.repository.CrudRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>

      public class IgniteRepositoryImpl<T,ID extends Serializable>
      extends Object
      implements IgniteRepository<T,ID>

  General Apache Ignite repository implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IgniteRepositoryImpl(IgniteCache<ID,T> cache)` Repository constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `count()`
    `void` | `delete(ID id)`
    `void` | `delete(Iterable<? extends T> entities)`
    `void` | `delete(T entity)`
    `void` | `deleteAll()`
    `void` | `deleteAll(Iterable<ID> ids)` Deletes all the entities for the provided ids.
    `boolean` | `exists(ID id)`
    `Iterable<T>` | `findAll()`
    `Iterable<T>` | `findAll(Iterable<ID> ids)`
    `T` | `findOne(ID id)`
    `<S extends T> S` | `save(ID key, S entity)` Saves a given entity using provided key.
    `<S extends T> Iterable<S>` | `save(Iterable<S> entities)`
    `<S extends T> Iterable<S>` | `save(Map<ID,S> entities)` Saves all given keys and entities combinations.
    `<S extends T> S` | `save(S entity)`

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

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

    - ### Methods inherited from interface org.springframework.data.repository.CrudRepository

      `deleteAll, deleteById, existsById, findAllById, findById, saveAll`

- - ### Constructor Detail

    - #### IgniteRepositoryImpl

          public IgniteRepositoryImpl(IgniteCache<ID,T> cache)

      Repository constructor.
      Parameters:
        `cache` - Initialized cache instance.

  - ### Method Detail

    - #### save

          public <S extends T> S save(ID key,
                                      S entity)

      Saves a given entity using provided key. It's suggested to use this method instead of default `CrudRepository.save(Object)` that generates IDs (keys) that are not unique cluster wide.
      Specified by:
        `save` in interface `IgniteRepository<T,ID extends Serializable>`
      Type Parameters:
        `S` - Entity type.
      Parameters:
        `key` - Entity's key.
        `entity` - Entity to save.
      Returns:
        Saved entity.

    - #### save

          public <S extends T> Iterable<S> save(Map<ID,S> entities)

      Saves all given keys and entities combinations. It's suggested to use this method instead of default `CrudRepository#save(Iterable)` that generates IDs (keys) that are not unique cluster wide.
      Specified by:
        `save` in interface `IgniteRepository<T,ID extends Serializable>`
      Type Parameters:
        `S` - type of entities.
      Parameters:
        `entities` - Map of key-entities pairs to save.
      Returns:
        Saved entities.

    - #### save

          public <S extends T> S save(S entity)

      Specified by:
        `save` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

    - #### save

          public <S extends T> Iterable<S> save(Iterable<S> entities)

    - #### findOne

          public T findOne(ID id)

    - #### exists

          public boolean exists(ID id)

    - #### findAll

          public Iterable<T> findAll()

      Specified by:
        `findAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

    - #### findAll

          public Iterable<T> findAll(Iterable<ID> ids)

    - #### count

          public long count()

      Specified by:
        `count` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

    - #### delete

          public void delete(ID id)

    - #### delete

          public void delete(T entity)

      Specified by:
        `delete` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

    - #### delete

          public void delete(Iterable<? extends T> entities)

    - #### deleteAll

          public void deleteAll(Iterable<ID> ids)

      Deletes all the entities for the provided ids.
      Specified by:
        `deleteAll` in interface `IgniteRepository<T,ID extends Serializable>`
      Parameters:
        `ids` - List of ids to delete.

    - #### deleteAll

          public void deleteAll()

      Specified by:
        `deleteAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

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