Abstract implementation on the Session interface for MongoDB
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
MONGO_SET_OPERATOR |
|
static java.lang.String |
MONGO_UNSET_OPERATOR |
|
protected static java.util.Map<PersistentEntity, com.mongodb.WriteConcern> |
declaredWriteConcerns |
|
protected java.lang.String |
defaultDatabase |
|
protected boolean |
errorOccured |
|
protected java.util.Map<PersistentEntity, java.lang.String> |
mongoCollections |
|
protected java.util.Map<PersistentEntity, java.lang.String> |
mongoDatabases |
|
protected MongoDatastore |
mongoDatastore |
|
protected com.mongodb.WriteConcern |
writeConcern |
| Fields inherited from class | Fields |
|---|---|
class AbstractSession |
ENTITY_ACCESS, cacheAdapterRepository, firstLevelCache, firstLevelCollectionCache, firstLevelEntryCache, firstLevelEntryCacheDirtyCheck, flushActive, isSynchronizedWithTransaction, lockedObjects, persisters, postFlushOperations, publisher, stateless, transaction |
class AbstractAttributeStoringSession |
attributes, sessionPropertyMap |
| Constructor and description |
|---|
AbstractMongoSession
(MongoDatastore datastore, MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher) |
AbstractMongoSession
(MongoDatastore datastore, MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher, boolean stateless) |
| Type | Name and description |
|---|---|
protected void |
addPostFlushOperations(java.util.List<PendingOperation> cascadeOperations) |
T |
decode(java.lang.Class<T> type, java.lang.Object nativeObject)Decodes the given entity type from the given native object type |
void |
flush() |
void |
flush(com.mongodb.WriteConcern writeConcern) |
com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection(PersistentEntity entity) |
java.lang.String |
getCollectionName(PersistentEntity entity) |
java.lang.String |
getDatabase(PersistentEntity entity)@return The name of the default database |
MongoDatastore |
getDatastore() |
com.mongodb.WriteConcern |
getDeclaredWriteConcern(PersistentEntity entity) |
java.lang.String |
getDefaultDatabase()@return The name of the default database |
DocumentMappingContext |
getDocumentMappingContext() |
com.mongodb.MongoClient |
getNativeInterface() |
com.mongodb.WriteConcern |
getWriteConcern()Obtains the WriteConcern to use for the session |
void |
setWriteConcern(com.mongodb.WriteConcern writeConcern)Sets the WriteConcern to use for the session |
java.lang.String |
useCollection(PersistentEntity entity, java.lang.String collectionName)Use the given collection for the given entity |
java.lang.String |
useDatabase(PersistentEntity entity, java.lang.String databaseName)Use the given database name for the given entity |
Decodes the given entity type from the given native object type
type - A GORM entity typenativeObject - A native MongoDB object type (Document, FinderIterable etc.) - The concrete type of the entity
Obtains the WriteConcern to use for the session
Sets the WriteConcern to use for the session
writeConcern - The WriteConcern to useUse the given collection for the given entity
entity - The entitycollectionName - The collectionUse the given database name for the given entity
entity - The entity namedatabaseName - The database name