Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2011-2012 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
import  org.springframework.util.Assert;
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

Mark Pollack
Oliver Gierke
public class MongoAction {
	private final String collectionName;
	private final Class<?> entityType;
	private final DBObject query;
	private final DBObject document;

Create an instance of a MongoAction.

defaultWriteConcern the default write concern.
mongoActionOperation action being taken against the collection
collectionName the collection name, must not be null or empty.
entityType the POJO that is being operated against
document the converted DBObject from the POJO or Spring Update object
query the converted DBOjbect from the Spring Query object
	public MongoAction(WriteConcern defaultWriteConcernMongoActionOperation mongoActionOperation,
			String collectionNameClass<?> entityTypeDBObject documentDBObject query) {
		Assert.hasText(collectionName"Collection name must not be null or empty!");
		this. = defaultWriteConcern;
		this. = mongoActionOperation;
		this. = collectionName;
		this. = entityType;
		this. = query;
		this. = document;

use getEntityType() instead.
	public Class<?> getEntityClass() {
		return ;
	public Class<?> getEntityType() {
		return ;
	public DBObject getQuery() {
		return ;
	public DBObject getDocument() {
		return ;
New to GrepCode? Check out our FAQ X