public abstract class AbstractMongoCollection<P> extends java.lang.Object implements MongoCollection<P>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
idField |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMongoCollection(java.lang.String databaseName,
java.lang.String collectionName,
java.lang.String idField) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDocument(Document document) |
protected abstract P |
addDocumentInternal(Document document) |
void |
addIndex(Index<P> index) |
int |
count(Document query,
int skip,
int limit) |
int |
deleteDocuments(Document selector,
int limit) |
protected boolean |
documentMatchesQuery(Document document,
Document query) |
Document |
findAndModify(Document query) |
protected abstract P |
findDocumentPosition(Document document) |
java.lang.String |
getCollectionName() |
java.lang.String |
getDatabaseName() |
protected abstract long |
getDataSize() |
protected abstract Document |
getDocument(P position) |
java.lang.String |
getFullName() |
int |
getNumIndexes() |
Document |
getStats() |
Document |
handleDistinct(Document query) |
java.lang.Iterable<Document> |
handleQuery(Document queryObject,
int numberToSkip,
int numberToReturn,
Document fieldSelector) |
protected abstract void |
handleUpdate(Document document) |
int |
insertDocuments(java.util.List<Document> documents) |
protected abstract java.lang.Iterable<Document> |
matchDocuments(Document query,
Document orderBy,
int numberToSkip,
int numberToReturn) |
protected abstract java.lang.Iterable<Document> |
matchDocuments(Document query,
java.lang.Iterable<P> positions,
Document orderBy,
int numberToSkip,
int numberToReturn) |
void |
removeDocument(Document document) |
protected abstract void |
removeDocument(P position) |
void |
renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName) |
protected void |
sortDocumentsInMemory(java.util.List<Document> documents,
Document orderBy) |
java.lang.String |
toString() |
protected abstract void |
updateDataSize(long sizeDelta) |
Document |
updateDocuments(Document selector,
Document updateQuery,
boolean isMulti,
boolean isUpsert) |
Document |
validate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcount, handleQuery, handleQuery, queryAllprotected AbstractMongoCollection(java.lang.String databaseName,
java.lang.String collectionName,
java.lang.String idField)
protected void sortDocumentsInMemory(java.util.List<Document> documents, Document orderBy)
protected abstract java.lang.Iterable<Document> matchDocuments(Document query, Document orderBy, int numberToSkip, int numberToReturn)
protected abstract java.lang.Iterable<Document> matchDocuments(Document query, java.lang.Iterable<P> positions, Document orderBy, int numberToSkip, int numberToReturn)
protected abstract void updateDataSize(long sizeDelta)
protected abstract long getDataSize()
public void addDocument(Document document)
addDocument in interface MongoCollection<P>public java.lang.String getDatabaseName()
getDatabaseName in interface MongoCollection<P>public java.lang.String getFullName()
getFullName in interface MongoCollection<P>public java.lang.String getCollectionName()
getCollectionName in interface MongoCollection<P>public java.lang.String toString()
toString in class java.lang.Objectpublic void addIndex(Index<P> index)
addIndex in interface MongoCollection<P>public Document findAndModify(Document query)
findAndModify in interface MongoCollection<P>public java.lang.Iterable<Document> handleQuery(Document queryObject, int numberToSkip, int numberToReturn, Document fieldSelector)
handleQuery in interface MongoCollection<P>public Document handleDistinct(Document query)
handleDistinct in interface MongoCollection<P>public int insertDocuments(java.util.List<Document> documents)
insertDocuments in interface MongoCollection<P>public int deleteDocuments(Document selector, int limit)
deleteDocuments in interface MongoCollection<P>public Document updateDocuments(Document selector, Document updateQuery, boolean isMulti, boolean isUpsert)
updateDocuments in interface MongoCollection<P>protected abstract void handleUpdate(Document document)
public int getNumIndexes()
getNumIndexes in interface MongoCollection<P>public int count(Document query, int skip, int limit)
count in interface MongoCollection<P>public Document getStats()
getStats in interface MongoCollection<P>public void removeDocument(Document document)
removeDocument in interface MongoCollection<P>public Document validate()
validate in interface MongoCollection<P>public void renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName)
renameTo in interface MongoCollection<P>protected abstract void removeDocument(P position)