org.synyx.hades.dao.query
Class QueryMethod

java.lang.Object
  extended by org.synyx.hades.dao.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 Hades specific information that is necessary to construct HadesQuerys for the method.

Author:
Oliver Gierke - gierke@synyx.de

Constructor Summary
QueryMethod(java.lang.reflect.Method method, java.lang.Class<?> domainClass, javax.persistence.EntityManager em, QueryExtractor extractor)
          Creates a new QueryMethod.
QueryMethod(java.lang.reflect.Method method, java.lang.Class<?> domainClass, javax.persistence.EntityManager em, QueryExtractor extractor, QueryLookupStrategy strategy)
          Creates a new QueryMethod from the given parameters.
 
Method Summary
 java.lang.Object executeQuery(java.lang.Object... methodParameters)
          Executes the Query backing the QueryMethod with the given parameters.
 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,
                   java.lang.Class<?> domainClass,
                   javax.persistence.EntityManager em,
                   QueryExtractor extractor,
                   QueryLookupStrategy strategy)
Creates a new QueryMethod from the given parameters. Looks up the correct query to use for following invocations of the method given.

Parameters:
method -
domainClass -
em -
strategy -

QueryMethod

public QueryMethod(java.lang.reflect.Method method,
                   java.lang.Class<?> domainClass,
                   javax.persistence.EntityManager em,
                   QueryExtractor extractor)
Creates a new QueryMethod. Assumes applying default QueryLookupStrategy by handing null.

Parameters:
method -
domainClass -
em -
extractor -
Method Detail

executeQuery

public java.lang.Object executeQuery(java.lang.Object... methodParameters)
Executes the Query backing the QueryMethod with the given parameters.

Parameters:
em -
parameters -
Returns:

toString

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


Copyright © 2009-2010 Synyx GmbH & Co. KG. All Rights Reserved.