Spring Data MongoDB - Core

org.springframework.data.mongodb.repository.query
Class AbstractMongoQuery

java.lang.Object
  extended by org.springframework.data.mongodb.repository.query.AbstractMongoQuery
All Implemented Interfaces:
RepositoryQuery
Direct Known Subclasses:
PartTreeMongoQuery, StringBasedMongoQuery

public abstract class AbstractMongoQuery
extends Object
implements RepositoryQuery

Base class for RepositoryQuery implementations for Mongo.

Author:
Oliver Gierke, Thomas Darimont, Christoph Strobl

Constructor Summary
AbstractMongoQuery(MongoQueryMethod method, MongoOperations operations)
          Creates a new AbstractMongoQuery from the given MongoQueryMethod and MongoOperations.
 
Method Summary
protected  Query createCountQuery(ConvertingParameterAccessor accessor)
          Creates a Query instance using the given ConvertingParameterAccessor.
protected abstract  Query createQuery(ConvertingParameterAccessor accessor)
          Creates a Query instance using the given ParameterAccessor
 Object execute(Object[] parameters)
           
 MongoQueryMethod getQueryMethod()
           
protected abstract  boolean isCountQuery()
          Returns whether the query should get a count projection applied.
protected abstract  boolean isDeleteQuery()
          Return weather the query should delete matching documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMongoQuery

public AbstractMongoQuery(MongoQueryMethod method,
                          MongoOperations operations)
Creates a new AbstractMongoQuery from the given MongoQueryMethod and MongoOperations.

Parameters:
method - must not be null.
operations - must not be null.
Method Detail

getQueryMethod

public MongoQueryMethod getQueryMethod()
Specified by:
getQueryMethod in interface RepositoryQuery

execute

public Object execute(Object[] parameters)
Specified by:
execute in interface RepositoryQuery

createCountQuery

protected Query createCountQuery(ConvertingParameterAccessor accessor)
Creates a Query instance using the given ConvertingParameterAccessor. Will delegate to createQuery(ConvertingParameterAccessor) by default but allows customization of the count query to be triggered.

Parameters:
accessor - must not be null.
Returns:

createQuery

protected abstract Query createQuery(ConvertingParameterAccessor accessor)
Creates a Query instance using the given ParameterAccessor

Parameters:
accessor - must not be null.
Returns:

isCountQuery

protected abstract boolean isCountQuery()
Returns whether the query should get a count projection applied.

Returns:

isDeleteQuery

protected abstract boolean isDeleteQuery()
Return weather the query should delete matching documents.

Returns:
Since:
1.5

Spring Data MongoDB - Core

Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.