@Repository public class SimpleArangoRepository<T> extends Object implements ArangoRepository<T>
Constructor and Description |
---|
SimpleArangoRepository(ArangoOperations arangoOperations,
Class<T> domainClass) |
Modifier and Type | Method and Description |
---|---|
long |
count()
Counts the number of documents in the collection for the type of this repository
|
<S extends T> |
count(org.springframework.data.domain.Example<S> example)
Counts the number of documents in the collection which match with the given example
|
void |
delete(Iterable<? extends T> entities)
Deletes all the given documents from the database
|
void |
delete(String s)
Deletes the document with the given id or key
|
void |
delete(T entity)
Deletes document in the database representing the given object, by getting it's id
|
void |
deleteAll()
Deletes all documents in the collection for this repository
|
<S extends T> |
exists(org.springframework.data.domain.Example<S> example)
Checks if any documents match with the given example
|
boolean |
exists(String s)
Checks if a document exists or not based on the given id or key
|
Iterable<T> |
findAll()
Gets all documents in the collection for the class type of this repository
|
<S extends T> |
findAll(org.springframework.data.domain.Example<S> example)
Finds all documents which match with the given example
|
<S extends T> |
findAll(org.springframework.data.domain.Example<S> example,
org.springframework.data.domain.Pageable pageable)
Finds all documents which match with the given example, with pagination
|
<S extends T> |
findAll(org.springframework.data.domain.Example<S> example,
org.springframework.data.domain.Sort sort)
Finds all documents which match with the given example, then apply the given sort to results
|
Iterable<T> |
findAll(Iterable<String> strings)
Finds all documents with the an id or key in the argument
|
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable)
Gets all documents in the collection for the class type of this repository, with pagination
|
Iterable<T> |
findAll(org.springframework.data.domain.Sort sort)
Gets all documents in the collection for the class type of this repository, with the given sort applied
|
<S extends T> |
findOne(org.springframework.data.domain.Example<S> example)
Finds one document which matches the given example object
|
T |
findOne(String id)
Finds if a document with the given id exists in the database
|
<S extends T> |
save(Iterable<S> entities)
Saves the given iterable of entities to the database
|
<S extends T> |
save(S entity)
Saves the passed entity to the database using upsert from the template
|
public SimpleArangoRepository(ArangoOperations arangoOperations, Class<T> domainClass)
arangoOperations
- The template used to execute much of the functionality of this classdomainClass
- the class type of this repositorypublic <S extends T> S save(S entity)
public <S extends T> Iterable<S> save(Iterable<S> entities)
public boolean exists(String s)
public Iterable<T> findAll()
public Iterable<T> findAll(Iterable<String> strings)
public long count()
public void delete(String s)
public void delete(T entity)
public void delete(Iterable<? extends T> entities)
public void deleteAll()
public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
public <S extends T> S findOne(org.springframework.data.domain.Example<S> example)
findOne
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- example object to construct query withpublic <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example)
findAll
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- example object to construct query withpublic <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
findAll
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- example object to construct query withsort
- sort object to sort resultspublic <S extends T> org.springframework.data.domain.Page<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)
findAll
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- example object to construct query withpageable
- pageable object to apply pagination withpublic <S extends T> long count(org.springframework.data.domain.Example<S> example)
count
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- example object to construct query withpublic <S extends T> boolean exists(org.springframework.data.domain.Example<S> example)
exists
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
S
- example
- Copyright © 2017 ArangoDB GmbH. All rights reserved.