Package com.oracle.nosql.spring.data.repository.support

# Class SimpleNosqlRepository<T,ID extends Serializable>

java.lang.Object
com.oracle.nosql.spring.data.repository.support.SimpleNosqlRepository<T,ID>

All Implemented Interfaces:
  `NosqlRepository<T,ID>`, `org.springframework.data.repository.CrudRepository<T,ID>`, `org.springframework.data.repository.PagingAndSortingRepository<T,ID>`, `org.springframework.data.repository.Repository<T,ID>`

public class SimpleNosqlRepository<T,ID extends Serializable> extends Object implements NosqlRepository<T,ID>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleNosqlRepository(NosqlEntityInformation<T,ID> metadata, NosqlOperations dbOperations)`
  `SimpleNosqlRepository(NosqlEntityInformation<T,ID> entityInformation, org.springframework.context.ApplicationContext applicationContext)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearPreparedStatementsCache()`
  Clears the prepared statements cache.
  `long`
  `count()`
  Return count of rows in the table.
  `void`
  `delete(T entity)`
  Delete one row for entity.
  `void`
  `deleteAll()`
  Delete all rows from table.
  `void`
  `deleteAll(Iterable<? extends T> entities)`
  Delete list of entities from table.
  `void`
  `deleteAllById(Iterable<? extends ID> ids)`
  `void`
  `deleteById(ID id)`
  Delete one row for id.
  `boolean`
  `existsById(ID primaryKey)`
  Check if an entity exists per id.
  `Iterable<T>`
  `findAll()`
  Find all entities from the table.
  `org.springframework.data.domain.Page<T>`
  `findAll(org.springframework.data.domain.Pageable pageable)`
  Returns a Page of entities meeting the paging restriction provided in the Pageable object.
  `Iterable<T>`
  `findAll(org.springframework.data.domain.Sort sort)`
  Returns all entities sorted by the given options.
  `Iterable<T>`
  `findAllById(Iterable<ID> ids)`
  Find entities based on id list.
  `Optional<T>`
  `findById(ID id)`
  Find entity by its id.
  `String`
  `getConsistency()`
  Returns the configured read request consistency value.
  `String`
  `getDurability()`
  Returns the configured request durability value.
  `int`
  `getTimeout()`
  Returns the configured request timeout value, in milliseconds, or 0 if it has not been set.
  `<S extends T>
  S`
  `save(S entity)`
  Save entity.
  `<S extends T>
  Iterable<S>`
  `saveAll(Iterable<S> entities)`
  Batch save entities.
  `void`
  `setConsistency(String consistency)`
  Sets the read request consistency value.
  `void`
  `setDurability(String durability)`
  Sets the request durability value.
  `void`
  `setTimeout(int milliseconds)`
  Sets the request timeout value, in milliseconds.

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

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

- ## Constructor Details

  - ### SimpleNosqlRepository

    public SimpleNosqlRepository(NosqlEntityInformation<T,ID> entityInformation, org.springframework.context.ApplicationContext applicationContext)

  - ### SimpleNosqlRepository

    public SimpleNosqlRepository(NosqlEntityInformation<T,ID> metadata, NosqlOperations dbOperations)

- ## Method Details

  - ### save

    public <S extends T> S save(S entity)
    Save entity.
    Specified by:
      `save` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `save` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### saveAll

    public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
    Batch save entities.
    Specified by:
      `saveAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `saveAll` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### findAll

    public Iterable<T> findAll()
    Find all entities from the table.
    Specified by:
      `findAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `findAll` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### findAllById

    public Iterable<T> findAllById(Iterable<ID> ids)
    Find entities based on id list.
    Specified by:
      `findAllById` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `findAllById` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### findById

    public Optional<T> findById(ID id)
    Find entity by its id.
    Specified by:
      `findById` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `findById` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### count

    public long count()
    Return count of rows in the table.
    Specified by:
      `count` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `count` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### deleteById

    public void deleteById(ID id)
    Delete one row for id.
    Specified by:
      `deleteById` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `deleteById` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### delete

    public void delete(T entity)
    Delete one row for entity.
    Specified by:
      `delete` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `delete` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### deleteAllById

    public void deleteAllById(Iterable<? extends ID> ids)
    Specified by:
      `deleteAllById` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`

  - ### deleteAll

    public void deleteAll()
    Delete all rows from table.
    Specified by:
      `deleteAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `deleteAll` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### deleteAll

    public void deleteAll(Iterable<? extends T> entities)
    Delete list of entities from table.
    Specified by:
      `deleteAll` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `deleteAll` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### existsById

    public boolean existsById(ID primaryKey)
    Check if an entity exists per id.
    Specified by:
      `existsById` in interface `org.springframework.data.repository.CrudRepository<T,ID extends Serializable>`
    Specified by:
      `existsById` in interface `NosqlRepository<T,ID extends Serializable>`

  - ### findAll

    public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
    Returns all entities sorted by the given options.
    Specified by:
      `findAll` in interface `NosqlRepository<T,ID extends Serializable>`
    Specified by:
      `findAll` in interface `org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>`

  - ### findAll

    public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
    Returns a Page of entities meeting the paging restriction provided in the Pageable object.
    Specified by:
      `findAll` in interface `NosqlRepository<T,ID extends Serializable>`
    Specified by:
      `findAll` in interface `org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>`

  - ### getTimeout

    public int getTimeout()
    Description copied from interface: `NosqlRepository`
    Returns the configured request timeout value, in milliseconds, or 0 if it has not been set.
    Specified by:
      `getTimeout` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.getTimeout()`

  - ### setTimeout

    public void setTimeout(int milliseconds)
    Description copied from interface: `NosqlRepository`
    Sets the request timeout value, in milliseconds. This overrides any default value set in NoSQLHandleConfig. The value must be positive. This set takes precedence over the one set when using `NosqlTable.timeout()`.
    Specified by:
      `setTimeout` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.setTimeout(int)`

  - ### getConsistency

    public String getConsistency()
    Description copied from interface: `NosqlRepository`
    Returns the configured read request consistency value.
    Specified by:
      `getConsistency` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.getConsistency()`

  - ### setConsistency

    public void setConsistency(String consistency)
    Description copied from interface: `NosqlRepository`
    Sets the read request consistency value. The value must be one of `Consistency` values. This set takes precedence over the one set when using `NosqlTable.consistency()`.
    Specified by:
      `setConsistency` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.setConsistency(String)`

  - ### getDurability

    public String getDurability()
    Description copied from interface: `NosqlRepository`
    Returns the configured request durability value.
    Specified by:
      `getDurability` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.getDurability()`

  - ### setDurability

    public void setDurability(String durability)
    Description copied from interface: `NosqlRepository`
    Sets the request durability value. The value must be one of the defined Durability values: `Durability.COMMIT_NO_SYNC`, `Durability.COMMIT_WRITE_NO_SYNC` or `Durability.COMMIT_SYNC`.

    This set takes precedence over the one set when using `NosqlTable.durability()`.

    If null or invalid value is provided durability will be set to `Durability.COMMIT_NO_SYNC`

    Note: This applies to On-Prem installations only.

    Specified by:
      `setDurability` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.setDurability(String)`

  - ### clearPreparedStatementsCache

    public void clearPreparedStatementsCache()
    Description copied from interface: `NosqlRepository`
    Clears the prepared statements cache.
    Specified by:
      `clearPreparedStatementsCache` in interface `NosqlRepository<T,ID extends Serializable>`
    See Also:
      - `NosqlRepository.clearPreparedStatementsCache()`