@Repository public class SimpleArangoRepository<T,ID> extends Object implements ArangoRepository<T,ID>
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(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
|
void |
deleteAll(Iterable<? extends T> entities)
Deletes all the given documents from the database
|
void |
deleteAllById(Iterable<? extends ID> ids)
Deletes all instances of the type
T with the given IDs. |
void |
deleteById(ID id)
Deletes the document with the given id or key
|
<S extends T> |
exists(org.springframework.data.domain.Example<S> example)
Checks if any documents match with the given example
|
boolean |
existsById(ID id)
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
|
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
|
Iterable<T> |
findAllById(Iterable<ID> ids)
Finds all documents with the an id or key in the argument
|
<S extends T,R> |
findBy(org.springframework.data.domain.Example<S> example,
Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction) |
Optional<T> |
findById(ID id)
Finds if a document with the given id exists in the database
|
<S extends T> |
findOne(org.springframework.data.domain.Example<S> example)
Finds one document which matches the given example object
|
<S extends T> |
save(S entity)
Saves the passed entity to the database using repsert from the template
|
<S extends T> |
saveAll(Iterable<S> entities)
Saves the given iterable of entities to the database using repsert 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> saveAll(Iterable<S> entities)
public Optional<T> findById(ID id)
public boolean existsById(ID id)
public Iterable<T> findAll()
public Iterable<T> findAllById(Iterable<ID> ids)
public long count()
public void deleteById(ID id)
public void delete(T entity)
public void deleteAllById(Iterable<? extends ID> ids)
T
with the given IDs.public void deleteAll(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> Optional<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–2023 ArangoDB GmbH. All rights reserved.