Spring Data Commmons

org.springframework.data.repository.query
Class QueryMethod

java.lang.Object
  extended by org.springframework.data.repository.query.QueryMethod

public class QueryMethod
extends Object

Abstraction of a method that is designated to execute a finder query. Enriches the standard Method interface with specific information that is necessary to construct RepositoryQuerys for the method.

Author:
Oliver Gierke

Constructor Summary
QueryMethod(Method method)
          Creates a new QueryMethod from the given parameters.
 
Method Summary
 Class<?> getDomainClass()
          Returns the domain class for this method.
 String getName()
          Returns the method's name.
 Parameters getParameters()
          Returns the Parameters wrapper to gain additional information about Method parameters.
 boolean isCollectionQuery()
          Returns whether the finder will actually return a collection of entities or a single one.
 boolean isCorrectNumberOfParameters(int number)
          Returns whether the given
 boolean isPageQuery()
          Returns whether the finder will return a Page of results.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryMethod

public QueryMethod(Method method)
Creates a new QueryMethod from the given parameters. Looks up the correct query to use for following invocations of the method given.

Parameters:
method - must not be null
Method Detail

getName

public String getName()
Returns the method's name.

Returns:

isCorrectNumberOfParameters

public boolean isCorrectNumberOfParameters(int number)
Returns whether the given

Parameters:
number -
Returns:

getDomainClass

public Class<?> getDomainClass()
Returns the domain class for this method.

Returns:

isCollectionQuery

public boolean isCollectionQuery()
Returns whether the finder will actually return a collection of entities or a single one.

Returns:

isPageQuery

public boolean isPageQuery()
Returns whether the finder will return a Page of results.

Returns:

getParameters

public Parameters getParameters()
Returns the Parameters wrapper to gain additional information about Method parameters.

Returns:

toString

public String toString()
Overrides:
toString in class Object

Spring Data Commmons

Copyright © 2011. All Rights Reserved.