ObjectDB ObjectDB

javax.persistence.EnumType - JPA enum

javax.persistence
Enum EnumType

java.lang.Object
    java.lang.Enum<javax.persistence.EnumType>
        javax.persistence.EnumType
Implemented Interfaces:
Serializable, Comparable<EnumType>
Defines mapping for enumerated types. The constants of this enumerated type specify how a persistent property or field of an enumerated type should be persisted.
Since:
JPA 1.0
Learn how to define and use enum fields in Chapter 2 of the ObjectDB/JPA manual.
Persist enumerated type property or field as an integer.
Persist enumerated type property or field as an integer.
Since:
JPA 1.0
Persist enumerated type property or field as a string.
Persist enumerated type property or field as a string.
Since:
JPA 1.0
EnumType valueOf(String name)

Returns the enum constant of this type with the specified 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.

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

Returns an array containing the constants of this enum type.

Returns an array containing the constants of this enum type.

This method may be used to iterate over the constants as follows:

for (EnumType c : EnumType.values())
    System.out.println(c)
Returns:
an array containing the constants of this enum type, in the order they are declared