public abstract class AbstractMongoRepository<K,V>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ETAG |
protected static java.lang.String |
ID |
| Constructor and Description |
|---|
AbstractMongoRepository() |
| Modifier and Type | Method and Description |
|---|---|
protected org.bson.Document |
byId(K key) |
protected abstract com.mongodb.client.MongoCollection<org.bson.Document> |
collection() |
void |
create(V value) |
void |
createOrUpdate(V value) |
protected abstract V |
decode(org.bson.Document document) |
void |
delete(K key) |
void |
deleteAll() |
protected abstract org.bson.Document |
encode(V value) |
protected abstract void |
ensureIndexes() |
java.util.List<V> |
findAll() |
java.util.List<V> |
findAll(int skip,
int limit) |
java.util.Optional<V> |
findOne(K key) |
protected abstract K |
keyOf(V value) |
protected org.bson.Document |
matchAll() |
long |
size() |
void |
update(V value) |
void |
updateIfMatch(V value,
java.lang.String eTag) |
protected static final java.lang.String ID
protected static final java.lang.String ETAG
public java.util.List<V> findAll()
public java.util.List<V> findAll(int skip, int limit)
public void createOrUpdate(V value)
public void create(V value)
public void update(V value)
public void updateIfMatch(V value, java.lang.String eTag)
public long size()
public void delete(K key)
public void deleteAll()
protected org.bson.Document byId(K key)
protected org.bson.Document matchAll()
protected abstract com.mongodb.client.MongoCollection<org.bson.Document> collection()
protected abstract org.bson.Document encode(V value)
protected abstract V decode(org.bson.Document document)
protected abstract void ensureIndexes()