public abstract class AbstractMongoSession extends AbstractSession
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, 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 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 Params | Return Type | Name and description |
---|---|---|
|
protected void |
addPostFlushOperations(java.util.List<PendingOperation> cascadeOperations) |
<T> |
public abstract T |
decode(java.lang.Class<T> type, java.lang.Object nativeObject) Decodes the given entity type from the given native object type |
|
public void |
flush() |
|
public abstract void |
flush(WriteConcern writeConcern) |
|
public com.mongodb.client.MongoCollection<Document> |
getCollection(PersistentEntity entity) |
|
public java.lang.String |
getCollectionName(PersistentEntity entity) |
|
public java.lang.String |
getDatabase(PersistentEntity entity)
|
|
public MongoDatastore |
getDatastore() |
|
public WriteConcern |
getDeclaredWriteConcern(PersistentEntity entity) |
|
public java.lang.String |
getDefaultDatabase()
|
|
public DocumentMappingContext |
getDocumentMappingContext() |
|
public MongoMappingContext |
getMappingContext() |
|
public MongoClient |
getNativeInterface() |
|
public WriteConcern |
getWriteConcern() Obtains the WriteConcern to use for the session |
|
public boolean |
hasTransaction() |
|
public void |
setWriteConcern(WriteConcern writeConcern) Sets the WriteConcern to use for the session |
|
public java.lang.String |
useCollection(PersistentEntity entity, java.lang.String collectionName) Use the given collection for the given entity |
|
public 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.)T
- 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