public enum SingleResultType extends Enum<SingleResultType>
Enum Constant and Description |
---|
ANY
Returns any result, or
null if nothing is found. |
JPA
Expects a single result, throws a
NoResultException or
NonUniqueResultException otherwise. |
OPTIONAL
Expects a single result.
|
Modifier and Type | Method and Description |
---|---|
static SingleResultType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SingleResultType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SingleResultType JPA
NoResultException
or
NonUniqueResultException
otherwise. This is the JPA
default behavior.public static final SingleResultType OPTIONAL
JPA
it returns null
if no result is found.public static final SingleResultType ANY
null
if nothing is found. If more than one result is found,
it returns the first one from the result list.public static SingleResultType[] values()
for (SingleResultType c : SingleResultType.values()) System.out.println(c);
public static SingleResultType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2018 The Apache Software Foundation. All rights reserved.