public class AerospikeTemplate extends Object implements AerospikeOperations
AerospikeOperations.| Constructor and Description |
|---|
AerospikeTemplate(com.aerospike.client.AerospikeClient client,
String namespace)
Deprecated.
|
AerospikeTemplate(com.aerospike.client.AerospikeClient client,
String namespace,
MappingAerospikeConverter converter,
AerospikeMappingContext mappingContext,
AerospikeExceptionTranslator exceptionTranslator)
Creates a new
AerospikeTemplate for the given
AerospikeClient. |
| 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) |
<T> long |
count(Class<T> entityClass,
String setName) |
<T> long |
count(Query query,
Class<T> entityClass) |
<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 |
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) |
<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.AerospikeClient |
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.AerospikeClient client,
String namespace,
MappingAerospikeConverter converter,
AerospikeMappingContext mappingContext,
AerospikeExceptionTranslator exceptionTranslator)
AerospikeTemplate for the given
AerospikeClient.client - must not be null.namespace - must not be null or empty.converter - mappingContext - exceptionTranslator - @Deprecated public AerospikeTemplate(com.aerospike.client.AerospikeClient client, String namespace)
public <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
AerospikeOperationscreateIndex in interface AerospikeOperationspublic <T> void deleteIndex(Class<T> entityClass, String indexName)
AerospikeOperationsdeleteIndex in interface AerospikeOperationspublic boolean indexExists(String indexName)
AerospikeOperationsindexExists in interface AerospikeOperationspublic <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 AerospikeOperationspublic <T> void persist(T document,
com.aerospike.client.policy.WritePolicy policy)
AerospikeOperationspersist in interface AerospikeOperationspublic <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 AerospikeOperationspublic <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 AerospikeOperationspublic <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 <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)
count in interface AerospikeOperationspublic <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)
count in interface AerospikeOperationspublic com.aerospike.client.AerospikeClient getAerospikeClient()
getAerospikeClient in interface AerospikeOperationspublic <T> long count(Class<T> entityClass, String setName)
count 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 © 2012–2020 Aerospike, Inc. All rights reserved.