Spring Data Commons

org.springframework.data.repository.query
Class QueryMethod

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

public class QueryMethod
extends java.lang.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(java.lang.reflect.Method method, RepositoryMetadata metadata)
          Creates a new QueryMethod from the given parameters.
 
Method Summary
protected  Parameters createParameters(java.lang.reflect.Method method)
          Creates a Parameters instance.
protected  java.lang.Class<?> getDomainClass()
          Returns the domain class the query method is targeted at.
 EntityMetadata<?> getEntityInformation()
           
 java.lang.String getName()
          Returns the method's name.
 java.lang.String getNamedQueryName()
          Returns the name of the named query this method belongs to.
 Parameters getParameters()
          Returns the Parameters wrapper to gain additional information about Method parameters.
 java.lang.Class<?> getReturnedObjectType()
          Returns the type of the object that will be returned.
 boolean isCollectionQuery()
          Returns whether the finder will actually return a collection of entities or a single one.
 boolean isModifyingQuery()
           
 boolean isPageQuery()
          Returns whether the finder will return a Page of results.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryMethod

public QueryMethod(java.lang.reflect.Method method,
                   RepositoryMetadata metadata)
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
metadata - must not be null
Method Detail

createParameters

protected Parameters createParameters(java.lang.reflect.Method method)
Creates a Parameters instance.

Parameters:
method -
Returns:
must not return null.

getName

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

Returns:

getEntityInformation

public EntityMetadata<?> getEntityInformation()

getNamedQueryName

public java.lang.String getNamedQueryName()
Returns the name of the named query this method belongs to.

Returns:

getDomainClass

protected java.lang.Class<?> getDomainClass()
Returns the domain class the query method is targeted at.

Returns:

getReturnedObjectType

public java.lang.Class<?> getReturnedObjectType()
Returns the type of the object that will be returned.

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:

isModifyingQuery

public boolean isModifyingQuery()

getParameters

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

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Spring Data Commons

Copyright © 2012. All Rights Reserved.