org.spicefactory.pimento.service
Enum QueryMode

java.lang.Object
  extended by java.lang.Enum<QueryMode>
      extended by org.spicefactory.pimento.service.QueryMode
All Implemented Interfaces:
Serializable, Comparable<QueryMode>

public enum QueryMode
extends Enum<QueryMode>

Represents the mode for a single query.

Author:
Jens Halm

Enum Constant Summary
EXECUTE_UPDATE
          A query that executes an update.
RESULT_LIST
          A query that produces a result list.
SINGLE_RESULT
          A query that produces a single result.
 
Method Summary
static QueryMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static QueryMode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SINGLE_RESULT

public static final QueryMode SINGLE_RESULT
A query that produces a single result. Corresponds to EntityManager.getSingleResult.


RESULT_LIST

public static final QueryMode RESULT_LIST
A query that produces a result list. Corresponds to EntityManager.getResultList.


EXECUTE_UPDATE

public static final QueryMode EXECUTE_UPDATE
A query that executes an update. Corresponds to EntityManager.executeUpdate. This query mode is not permitted by default. You can allow such a query type with PimentoConfig.setExecuteUpdatePermitted.

Method Detail

values

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

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

valueOf

public static QueryMode valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name