org.synyx.hades.dao.query
Enum QueryLookupStrategy

java.lang.Object
  extended by java.lang.Enum<QueryLookupStrategy>
      extended by org.synyx.hades.dao.query.QueryLookupStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<QueryLookupStrategy>

public enum QueryLookupStrategy
extends java.lang.Enum<QueryLookupStrategy>

Query lookup strategy to execute finders.

Author:
Oliver Gierke - gierke@synyx.de

Enum Constant Summary
CREATE
          Always creates the query from the given method.
CREATE_IF_NOT_FOUND
          Tries to lookup a declared query (either named query or an annotated Query but creates a query from the method name if no declared query found.
USE_DECLARED_QUERY
          Uses a named query named {@literal $DomainClass.
 
Method Summary
static QueryLookupStrategy fromXml(java.lang.String xml)
          Returns a strategy from the given XML value.
static QueryLookupStrategy getDefault()
          Returns the default strategy to be used.
abstract  org.synyx.hades.dao.query.HadesQuery resolveQuery(QueryMethod method)
          Resolves a HadesQuery from the given QueryMethod that can be executed afterwards.
static QueryLookupStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static QueryLookupStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CREATE

public static final QueryLookupStrategy CREATE
Always creates the query from the given method.


USE_DECLARED_QUERY

public static final QueryLookupStrategy USE_DECLARED_QUERY
Uses a named query named $DomainClass.$DaoMethodName.


CREATE_IF_NOT_FOUND

public static final QueryLookupStrategy CREATE_IF_NOT_FOUND
Tries to lookup a declared query (either named query or an annotated Query but creates a query from the method name if no declared query found.

Method Detail

values

public static QueryLookupStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (QueryLookupStrategy c : QueryLookupStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static QueryLookupStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

fromXml

public static QueryLookupStrategy fromXml(java.lang.String xml)
Returns a strategy from the given XML value.

Parameters:
xml -
Returns:
a strategy from the given XML value

getDefault

public static QueryLookupStrategy getDefault()
Returns the default strategy to be used.

Returns:

resolveQuery

public abstract org.synyx.hades.dao.query.HadesQuery resolveQuery(QueryMethod method)
Resolves a HadesQuery from the given QueryMethod that can be executed afterwards.

Parameters:
method -
Returns:


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