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
ConstructorsConstructorDescriptionSimpleNosqlRepository
(NosqlEntityInformation<T, ID> metadata, NosqlOperations dbOperations) SimpleNosqlRepository
(NosqlEntityInformation<T, ID> entityInformation, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the prepared statements cache.long
count()
Return count of rows in the table.void
Delete one row for entity.void
Delete all rows from table.void
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.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.findAll
(org.springframework.data.domain.Sort sort) Returns all entities sorted by the given options.findAllById
(Iterable<ID> ids) Find entities based on id list.Find entity by its id.Returns the configured read request consistency value.Returns the configured request durability value.int
Returns the configured request timeout value, in milliseconds, or 0 if it has not been set.<S extends T>
Ssave
(S entity) Save entity.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.
-
Constructor Details
-
SimpleNosqlRepository
public SimpleNosqlRepository(NosqlEntityInformation<T, ID> entityInformation, org.springframework.context.ApplicationContext applicationContext) -
SimpleNosqlRepository
-
-
Method Details
-
save
Save entity.- Specified by:
save
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
save
in interfaceNosqlRepository<T,
ID extends Serializable>
-
saveAll
Batch save entities.- Specified by:
saveAll
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
saveAll
in interfaceNosqlRepository<T,
ID extends Serializable>
-
findAll
Find all entities from the table.- Specified by:
findAll
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
findAll
in interfaceNosqlRepository<T,
ID extends Serializable>
-
findAllById
Find entities based on id list.- Specified by:
findAllById
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
findAllById
in interfaceNosqlRepository<T,
ID extends Serializable>
-
findById
Find entity by its id.- Specified by:
findById
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
findById
in interfaceNosqlRepository<T,
ID extends Serializable>
-
count
public long count()Return count of rows in the table.- Specified by:
count
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
count
in interfaceNosqlRepository<T,
ID extends Serializable>
-
deleteById
Delete one row for id.- Specified by:
deleteById
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
deleteById
in interfaceNosqlRepository<T,
ID extends Serializable>
-
delete
Delete one row for entity.- Specified by:
delete
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
delete
in interfaceNosqlRepository<T,
ID extends Serializable>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable>
-
deleteAll
public void deleteAll()Delete all rows from table.- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
deleteAll
in interfaceNosqlRepository<T,
ID extends Serializable>
-
deleteAll
Delete list of entities from table.- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
deleteAll
in interfaceNosqlRepository<T,
ID extends Serializable>
-
existsById
Check if an entity exists per id.- Specified by:
existsById
in interfaceorg.springframework.data.repository.CrudRepository<T,
ID extends Serializable> - Specified by:
existsById
in interfaceNosqlRepository<T,
ID extends Serializable>
-
findAll
Returns all entities sorted by the given options.- Specified by:
findAll
in interfaceNosqlRepository<T,
ID extends Serializable> - Specified by:
findAll
in interfaceorg.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 interfaceNosqlRepository<T,
ID extends Serializable> - Specified by:
findAll
in interfaceorg.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 interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
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 usingNosqlTable.timeout()
.- Specified by:
setTimeout
in interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
getConsistency
Description copied from interface:NosqlRepository
Returns the configured read request consistency value.- Specified by:
getConsistency
in interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
setConsistency
Description copied from interface:NosqlRepository
Sets the read request consistency value. The value must be one ofConsistency
values. This set takes precedence over the one set when usingNosqlTable.consistency()
.- Specified by:
setConsistency
in interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
getDurability
Description copied from interface:NosqlRepository
Returns the configured request durability value.- Specified by:
getDurability
in interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
setDurability
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
orDurability.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 interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-
clearPreparedStatementsCache
public void clearPreparedStatementsCache()Description copied from interface:NosqlRepository
Clears the prepared statements cache.- Specified by:
clearPreparedStatementsCache
in interfaceNosqlRepository<T,
ID extends Serializable> - See Also:
-