Hitachi

uCosminexus Application Server Compatibility Guide


8.12.16 @Enumerated

Organization of this subsection

(1) Description

This annotation specifies the persistence field or persistence property as the enumeration type.

This annotation can be used along with @Basic. You can specify ORDINAL (numeric type) and STRING (character string type) in the enumeration type.

In the following cases, ORDINAL (numeric type) is specified as the enumeration type:

The applicable targets are method and field.

(2) Element

The following table lists the elements of @Enumerated:

Element name

Optional/Required

Element description

value

Optional

This element specifies the type used for mapping the enumeration type.

The details of attributes that are supported with Cosminexus JPA provider are as follows:

(a) value element

Type

EnumType

Description

This element specifies the type used for mapping the enumeration type.

You can specify either of the following values:

  • EnumType.ORDINAL: Numeric type

  • EnumType.STRING: Character string type

Default value

EnumType.ORDINAL