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
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.data.mongodb.core;
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

Author(s):
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.

Parameters:
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;
	}
	}
	}

Deprecated:
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