public abstract class AbstractMongoSession extends org.grails.datastore.mapping.core.AbstractSession
Abstract implementation on the org.grails.datastore.mapping.core.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<org.grails.datastore.mapping.model.PersistentEntity, com.mongodb.WriteConcern> |
declaredWriteConcerns |
|
protected java.lang.String |
defaultDatabase |
|
protected boolean |
errorOccured |
|
protected java.util.Map<org.grails.datastore.mapping.model.PersistentEntity, java.lang.String> |
mongoCollections |
|
protected java.util.Map<org.grails.datastore.mapping.model.PersistentEntity, java.lang.String> |
mongoDatabases |
|
protected MongoDatastore |
mongoDatastore |
|
protected com.mongodb.WriteConcern |
writeConcern |
Fields inherited from class | Fields |
---|---|
class org.grails.datastore.mapping.core.AbstractSession |
ENTITY_ACCESS |
Constructor and description |
---|
AbstractMongoSession(MongoDatastore datastore, org.grails.datastore.mapping.model.MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher) |
AbstractMongoSession(MongoDatastore datastore, org.grails.datastore.mapping.model.MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher, boolean stateless) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
addPostFlushOperations(java.util.List<org.grails.datastore.mapping.core.impl.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(com.mongodb.WriteConcern writeConcern) |
|
public com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection(org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public java.lang.String |
getCollectionName(org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public java.lang.String |
getDatabase(org.grails.datastore.mapping.model.PersistentEntity entity)
|
|
public MongoDatastore |
getDatastore() |
|
public com.mongodb.WriteConcern |
getDeclaredWriteConcern(org.grails.datastore.mapping.model.PersistentEntity entity) |
|
public java.lang.String |
getDefaultDatabase()
|
|
public org.grails.datastore.mapping.document.config.DocumentMappingContext |
getDocumentMappingContext() |
|
public MongoMappingContext |
getMappingContext() |
|
public com.mongodb.client.MongoClient |
getNativeInterface() |
|
public com.mongodb.WriteConcern |
getWriteConcern() Obtains the WriteConcern to use for the session |
|
public boolean |
hasTransaction() |
|
public void |
setWriteConcern(com.mongodb.WriteConcern writeConcern) Sets the WriteConcern to use for the session |
|
public java.lang.String |
useCollection(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.String collectionName) Use the given collection for the given entity |
|
public java.lang.String |
useDatabase(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.String databaseName) Use the given database name for the given entity |
Methods inherited from class | Name |
---|---|
class org.grails.datastore.mapping.core.AbstractSession |
org.grails.datastore.mapping.core.AbstractSession#deleteAll(org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.mapping.core.AbstractSession#cacheEntry(org.grails.datastore.mapping.model.PersistentEntity, java.io.Serializable, java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#createEntityAccess(org.grails.datastore.mapping.model.PersistentEntity, java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#getCachedInstance(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#cacheInstance(java.lang.Class, java.io.Serializable, java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#addPendingInsert(org.grails.datastore.mapping.core.impl.PendingInsert), org.grails.datastore.mapping.core.AbstractSession#isPendingAlready(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#addPendingUpdate(org.grails.datastore.mapping.core.impl.PendingUpdate), org.grails.datastore.mapping.core.AbstractSession#addPendingDelete(org.grails.datastore.mapping.core.impl.PendingDelete), org.grails.datastore.mapping.core.AbstractSession#getPendingInserts(), org.grails.datastore.mapping.core.AbstractSession#getPendingUpdates(), org.grails.datastore.mapping.core.AbstractSession#getPendingDeletes(), org.grails.datastore.mapping.core.AbstractSession#retrieveAll(java.lang.Class, [Ljava.io.Serializable;), org.grails.datastore.mapping.core.AbstractSession#retrieveAll(java.lang.Class, java.lang.Iterable), org.grails.datastore.mapping.core.AbstractSession#registerPending(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#isStateless(org.grails.datastore.mapping.model.PersistentEntity), org.grails.datastore.mapping.core.AbstractSession#isStateless(), org.grails.datastore.mapping.core.AbstractSession#getMappingContext(), org.grails.datastore.mapping.core.AbstractSession#getDatastore(), org.grails.datastore.mapping.core.AbstractSession#addPostFlushOperation(java.lang.Runnable), org.grails.datastore.mapping.core.AbstractSession#beginTransaction(org.springframework.transaction.TransactionDefinition), org.grails.datastore.mapping.core.AbstractSession#beginTransaction(), org.grails.datastore.mapping.core.AbstractSession#getFlushMode(), org.grails.datastore.mapping.core.AbstractSession#setFlushMode(jakarta.persistence.FlushModeType), org.grails.datastore.mapping.core.AbstractSession#persist(java.lang.Iterable), org.grails.datastore.mapping.core.AbstractSession#persist(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#cacheCollection(org.grails.datastore.mapping.model.PersistentEntity, java.io.Serializable, java.util.Collection, java.lang.String), org.grails.datastore.mapping.core.AbstractSession#setSynchronizedWithTransaction(boolean), org.grails.datastore.mapping.core.AbstractSession#updateAll(org.grails.datastore.mapping.query.api.QueryableCriteria, java.util.Map), org.grails.datastore.mapping.core.AbstractSession#getTransaction(), org.grails.datastore.mapping.core.AbstractSession#hasTransaction(), org.grails.datastore.mapping.core.AbstractSession#isSchemaless(), org.grails.datastore.mapping.core.AbstractSession#createQuery(java.lang.Class), org.grails.datastore.mapping.core.AbstractSession#getCachedCollection(org.grails.datastore.mapping.model.PersistentEntity, java.io.Serializable, java.lang.String), org.grails.datastore.mapping.core.AbstractSession#getPersister(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#getCachedEntry(org.grails.datastore.mapping.model.PersistentEntity, java.io.Serializable, boolean), org.grails.datastore.mapping.core.AbstractSession#getCachedEntry(org.grails.datastore.mapping.model.PersistentEntity, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#getObjectIdentifier(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#lock(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#lock(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#insert(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#clear(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#clear(), org.grails.datastore.mapping.core.AbstractSession#flush(), org.grails.datastore.mapping.core.AbstractSession#contains(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#delete(java.lang.Iterable), org.grails.datastore.mapping.core.AbstractSession#delete(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#proxy(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#unlock(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#attach(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#isCached(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#retrieve(java.lang.Class, java.io.Serializable), org.grails.datastore.mapping.core.AbstractSession#isDirty(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#refresh(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#clearSessionProperty(java.lang.String), org.grails.datastore.mapping.core.AbstractSession#setSessionProperty(java.lang.String, java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#getSessionProperty(java.lang.String), org.grails.datastore.mapping.core.AbstractSession#setAttribute(java.lang.Object, java.lang.String, java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#getAttribute(java.lang.Object, java.lang.String), org.grails.datastore.mapping.core.AbstractSession#isConnected(), org.grails.datastore.mapping.core.AbstractSession#disconnect(), org.grails.datastore.mapping.core.AbstractSession#wait(long, int), org.grails.datastore.mapping.core.AbstractSession#wait(), org.grails.datastore.mapping.core.AbstractSession#wait(long), org.grails.datastore.mapping.core.AbstractSession#equals(java.lang.Object), org.grails.datastore.mapping.core.AbstractSession#toString(), org.grails.datastore.mapping.core.AbstractSession#hashCode(), org.grails.datastore.mapping.core.AbstractSession#getClass(), org.grails.datastore.mapping.core.AbstractSession#notify(), org.grails.datastore.mapping.core.AbstractSession#notifyAll(), org.grails.datastore.mapping.core.AbstractSession#getNativeInterface() |
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