public class SimpleNosqlRepository<T,ID extends Serializable> extends Object implements NosqlRepository<T,ID>
Constructor and Description |
---|
SimpleNosqlRepository(NosqlEntityInformation<T,ID> entityInformation,
org.springframework.context.ApplicationContext applicationContext) |
SimpleNosqlRepository(NosqlEntityInformation<T,ID> metadata,
NosqlOperations dbOperations) |
Modifier and Type | Method and Description |
---|---|
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> |
save(S entity)
Save entity.
|
<S extends T> |
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.
|
public SimpleNosqlRepository(NosqlEntityInformation<T,ID> entityInformation, org.springframework.context.ApplicationContext applicationContext)
public SimpleNosqlRepository(NosqlEntityInformation<T,ID> metadata, NosqlOperations dbOperations)
public <S extends T> S save(S entity)
save
in interface NosqlRepository<T,ID extends Serializable>
save
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
saveAll
in interface NosqlRepository<T,ID extends Serializable>
saveAll
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public Iterable<T> findAll()
findAll
in interface NosqlRepository<T,ID extends Serializable>
findAll
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public Iterable<T> findAllById(Iterable<ID> ids)
findAllById
in interface NosqlRepository<T,ID extends Serializable>
findAllById
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public Optional<T> findById(ID id)
findById
in interface NosqlRepository<T,ID extends Serializable>
findById
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public long count()
count
in interface NosqlRepository<T,ID extends Serializable>
count
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public void deleteById(ID id)
deleteById
in interface NosqlRepository<T,ID extends Serializable>
deleteById
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public void delete(T entity)
delete
in interface NosqlRepository<T,ID extends Serializable>
delete
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public void deleteAllById(Iterable<? extends ID> ids)
deleteAllById
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public void deleteAll()
deleteAll
in interface NosqlRepository<T,ID extends Serializable>
deleteAll
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public void deleteAll(Iterable<? extends T> entities)
deleteAll
in interface NosqlRepository<T,ID extends Serializable>
deleteAll
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public boolean existsById(ID primaryKey)
existsById
in interface NosqlRepository<T,ID extends Serializable>
existsById
in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
findAll
in interface NosqlRepository<T,ID extends Serializable>
findAll
in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
findAll
in interface NosqlRepository<T,ID extends Serializable>
findAll
in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
public int getTimeout()
NosqlRepository
getTimeout
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.getTimeout()
public void setTimeout(int milliseconds)
NosqlRepository
NosqlTable.timeout()
.setTimeout
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.setTimeout(int)
public String getConsistency()
NosqlRepository
getConsistency
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.getConsistency()
public void setConsistency(String consistency)
NosqlRepository
Consistency
values.
This set takes precedence over the one set when using
NosqlTable.consistency()
.setConsistency
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.setConsistency(String)
public String getDurability()
NosqlRepository
getDurability
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.getDurability()
public void setDurability(String durability)
NosqlRepository
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()
.
Note: This applies to On-Prem installations only.
setDurability
in interface NosqlRepository<T,ID extends Serializable>
NosqlRepository.setDurability(String)
Copyright © 2022 Oracle Corporation. All rights reserved.