public class AerospikeTemplate extends Object implements AerospikeOperations
AerospikeOperations.| Constructor and Description |
|---|
AerospikeTemplate(com.aerospike.client.IAerospikeClient client,
String namespace,
MappingAerospikeConverter converter,
AerospikeMappingContext mappingContext,
AerospikeExceptionTranslator exceptionTranslator,
QueryEngine queryEngine,
IndexRefresher indexRefresher) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
add(T objectToAddTo,
Map<String,Long> values) |
<T> T |
add(T objectToAddTo,
String binName,
long value) |
<T> Iterable<T> |
aggregate(com.aerospike.client.query.Filter filter,
Class<T> entityClass,
String module,
String function,
List<com.aerospike.client.Value> arguments) |
<T> T |
append(T objectToAppendTo,
Map<String,String> values) |
<T> T |
append(T objectToAppendTo,
String binName,
String value) |
<T> long |
count(Class<T> entityClass)
Returns the amount of records in the given entityClass's Aerospike set and AerospikeTemplate configured namespace.
|
<T> long |
count(Query query,
Class<T> entityClass)
Returns the amount of records in a query results.
|
<T> long |
count(String setName)
Returns the amount of records in the given Aerospike set and AerospikeTemplate configured namespace.
|
<T> void |
createIndex(Class<T> entityClass,
String indexName,
String binName,
com.aerospike.client.query.IndexType indexType)
Creates index by specified name in Aerospike.
|
<T> void |
createIndex(Class<T> entityClass,
String indexName,
String binName,
com.aerospike.client.query.IndexType indexType,
com.aerospike.client.query.IndexCollectionType indexCollectionType)
Creates index by specified name in Aerospike.
|
<T> void |
delete(Class<T> entityClass) |
<T> boolean |
delete(Object id,
Class<T> entityClass) |
<T> boolean |
delete(T objectToDelete) |
<T> void |
deleteIndex(Class<T> entityClass,
String indexName)
Deletes index by specified name from Aerospike.
|
<T> T |
execute(Supplier<T> supplier)
Execute operation against underlying store.
|
<T> boolean |
exists(Object id,
Class<T> entityClass) |
<T> boolean |
exists(Query query,
Class<T> entityClass) |
<T> Stream<T> |
find(Query query,
Class<T> entityClass) |
<T> Stream<T> |
findAll(Class<T> entityClass) |
<T> Iterable<T> |
findAll(Sort sort,
Class<T> entityClass) |
<T> T |
findById(Object id,
Class<T> entityClass) |
GroupedEntities |
findByIds(GroupedKeys groupedKeys)
Executes a single batch request to get results for several entities.
|
<T> List<T> |
findByIds(Iterable<?> ids,
Class<T> entityClass) |
<T> Stream<T> |
findInRange(long offset,
long limit,
Sort sort,
Class<T> entityClass) |
com.aerospike.client.IAerospikeClient |
getAerospikeClient() |
MappingContext<?,?> |
getMappingContext() |
String |
getNamespace() |
<T> String |
getSetName(Class<T> entityClass) |
boolean |
indexExists(String indexName)
Checks whether index by specified name exists in Aerospike.
|
<T> void |
insert(T document)
Insert operation using
RecordExistsAction.CREATE_ONLY policy. |
<T> void |
insertAll(Collection<? extends T> documents) |
<T> void |
persist(T document,
com.aerospike.client.policy.WritePolicy policy)
Persist document using specified WritePolicy.
|
<T> T |
prepend(T objectToPrependTo,
Map<String,String> values) |
<T> T |
prepend(T objectToPrependTo,
String fieldName,
String value) |
<T> void |
save(T document)
Save operation.
|
<T> void |
update(T document)
Update operation using
RecordExistsAction.REPLACE_ONLY policy
taking into consideration the version property of the document if it is present. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMappingContext, getSetNamepublic AerospikeTemplate(com.aerospike.client.IAerospikeClient client,
String namespace,
MappingAerospikeConverter converter,
AerospikeMappingContext mappingContext,
AerospikeExceptionTranslator exceptionTranslator,
QueryEngine queryEngine,
IndexRefresher indexRefresher)
public <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
AerospikeOperationscreateIndex in interface AerospikeOperationspublic <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType)
AerospikeOperationscreateIndex in interface AerospikeOperationspublic <T> void deleteIndex(Class<T> entityClass, String indexName)
AerospikeOperationsdeleteIndex in interface AerospikeOperationspublic boolean indexExists(String indexName)
AerospikeOperationsindexExists in interface AerospikeOperationsindexName - The Aerospike index namepublic <T> void save(T document)
AerospikeOperationsRecordExistsAction.REPLACE_ONLY policy
taking into consideration the version property of the document.
Version property will be updated with the server's version after successful operation.
If document does not have version property - record is updated with RecordExistsAction.REPLACE policy.
This means that when such record does not exist it will be created, otherwise updated.save in interface AerospikeOperationsdocument - The document to save.public <T> void persist(T document,
com.aerospike.client.policy.WritePolicy policy)
AerospikeOperationspersist in interface AerospikeOperationsdocument - The document to persist.policy - The Aerospike write policy for the inner Aerospike put operation.public <T> void insertAll(Collection<? extends T> documents)
public <T> void insert(T document)
AerospikeOperationsRecordExistsAction.CREATE_ONLY policy.
If document has version property it will be updated with the server's version after successful operation.insert in interface AerospikeOperationsdocument - The document to insert.public <T> void update(T document)
AerospikeOperationsRecordExistsAction.REPLACE_ONLY policy
taking into consideration the version property of the document if it is present.
If document has version property it will be updated with the server's version after successful operation.update in interface AerospikeOperationsdocument - The object to update.public <T> void delete(Class<T> entityClass)
delete in interface AerospikeOperationspublic <T> boolean delete(Object id, Class<T> entityClass)
delete in interface AerospikeOperationspublic <T> boolean delete(T objectToDelete)
delete in interface AerospikeOperationspublic <T> boolean exists(Object id, Class<T> entityClass)
exists in interface AerospikeOperationspublic <T> Stream<T> findAll(Class<T> entityClass)
findAll in interface AerospikeOperationspublic <T> T findById(Object id, Class<T> entityClass)
findById in interface AerospikeOperationspublic <T> List<T> findByIds(Iterable<?> ids, Class<T> entityClass)
findByIds in interface AerospikeOperationspublic GroupedEntities findByIds(GroupedKeys groupedKeys)
findByIds in interface AerospikeOperationsgroupedKeys - will never be null.public <T> Iterable<T> aggregate(com.aerospike.client.query.Filter filter, Class<T> entityClass, String module, String function, List<com.aerospike.client.Value> arguments)
aggregate in interface AerospikeOperationspublic <T> Iterable<T> findAll(Sort sort, Class<T> entityClass)
findAll in interface AerospikeOperationspublic <T> T execute(Supplier<T> supplier)
AerospikeOperationsexecute in interface AerospikeOperationssupplier - must not be null.public <T> long count(Query query, Class<T> entityClass)
AerospikeOperationscount in interface AerospikeOperationsquery - The query that provides the result set for count.entityClass - The class to provide for the query.public <T> Stream<T> find(Query query, Class<T> entityClass)
find in interface AerospikeOperationspublic <T> Stream<T> findInRange(long offset, long limit, Sort sort, Class<T> entityClass)
findInRange in interface AerospikeOperationspublic <T> long count(Class<T> entityClass)
AerospikeOperationscount in interface AerospikeOperationsentityClass - The class to extract the Aerospike set from.public com.aerospike.client.IAerospikeClient getAerospikeClient()
getAerospikeClient in interface AerospikeOperationspublic <T> long count(String setName)
AerospikeOperationscount in interface AerospikeOperationspublic <T> T prepend(T objectToPrependTo,
String fieldName,
String value)
prepend in interface AerospikeOperationspublic <T> T prepend(T objectToPrependTo,
Map<String,String> values)
prepend in interface AerospikeOperationspublic <T> T append(T objectToAppendTo,
Map<String,String> values)
append in interface AerospikeOperationspublic <T> T append(T objectToAppendTo,
String binName,
String value)
append in interface AerospikeOperationspublic <T> T add(T objectToAddTo,
Map<String,Long> values)
add in interface AerospikeOperationspublic <T> T add(T objectToAddTo,
String binName,
long value)
add in interface AerospikeOperationspublic MappingContext<?,?> getMappingContext()
public String getNamespace()
Copyright © 2020–2021 Aerospike, Inc. All rights reserved.