org.springframework.data.mongodb.core

Class MongoAction



  • public class MongoAction
    extends Object
    Represents an action taken against the collection. Used by WriteConcernResolver to determine a custom WriteConcern based on this information.
    • INSERT, SAVE have null query
    • REMOVE has null document
    • INSERT_LIST has null entityType, document, and query
    Author:
    Mark Pollack, Oliver Gierke, Christoph Strobl
    • Constructor Detail

      • MongoAction

        public MongoAction(@Nullable
                           com.mongodb.WriteConcern defaultWriteConcern,
                           MongoActionOperation mongoActionOperation,
                           String collectionName,
                           @Nullable
                           Class<?> entityType,
                           @Nullable
                           org.bson.Document document,
                           @Nullable
                           org.bson.Document query)
        Create an instance of a MongoAction.
        Parameters:
        defaultWriteConcern - the default write concern. Can be null.
        mongoActionOperation - action being taken against the collection. Must not be null.
        collectionName - the collection name, must not be null or empty.
        entityType - the POJO that is being operated against. Can be null.
        document - the converted Document from the POJO or Spring Update object. Can be null.
        query - the converted Document from the Spring Query object. Can be null.
    • Method Detail

      • getCollectionName

        public String getCollectionName()
      • getDefaultWriteConcern

        @Nullable
        public com.mongodb.WriteConcern getDefaultWriteConcern()
      • getQuery

        @Nullable
        public org.bson.Document getQuery()
      • getDocument

        @Nullable
        public org.bson.Document getDocument()