ObjectDB ObjectDB

Internal Website Search

1-10 of 23 resultsRefresh
103

javax.persistence.EnumType

javax.persistence Enum EnumType java.lang.Object java.lang.Enum<javax.persistence.EnumType> javax.persistence.EnumType Implemented Interfaces: Serializable, Comparable<EnumType ... and use enum fields in Chapter 2 of the ObjectDB/JPA manual. EnumType ORDINAL Persist enumerated type
95

values()

Static Method javax.persistence.EnumType EnumType[] values() 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
91

valueOf(name)

Static Method javax.persistence.EnumType EnumType 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. Parameters: name - the name of the enum constant to be returned
88

EnumType.ORDINAL

Enum Constant javax.persistence.EnumType ORDINAL Persist enumerated type property or field as an integer. Since: JPA 1.0
88

EnumType.STRING

Enum Constant javax.persistence.EnumType STRING Persist enumerated type property or field as a string. Since: JPA 1.0
41

JPA Persistable Types

; // default is EnumType.ORDINAL @Enumerated(EnumType.ORDINAL) Color color2; @Enumerated(EnumType.STRING) Color color3; } enum Color { RED, GREEN, BLUE }; In the above example, values
35

JPA Annotations for Fields

Reference (JavaDoc) of JPA 2 field annotations, including @Basic, @Embedded, @EmbeddedId, @Version, @Transient, @Enumerated, @MapKeyEnumerated, @Temporal and @MapKeyTemporal.
31

@Enumerated(EnumType.STRING) annotation inhibits proper execution of IN expressions.

When the following annotation is present on an enum type entity field: @Enumerated(EnumType.STRING ... (EnumType.STRING), as your suggestion. It happened because ObjectDB considered a collection of emum values as a query parameter argument to be always @Enumerated(EnumType.ORDINAL). This is fixed now in build 2.6.1_05. support Support
12

javax.persistence.Enumerated

specified or the Enumerated annotation is not used, the EnumType value is assumed to be ORDINAL. Example ... enum fields in Chapter 2 of the ObjectDB/JPA manual. EnumType value (Optional) The type used in mapping an enum type. (Optional) The type used in mapping an enum type. Default value: javax.persistence.EnumType.ORDINAL Since: JPA 1.0
10

javax.persistence.MapKeyEnumerated

See Also: ElementCollection OneToMany ManyToMany EnumType value (Optional) The type used in mapping a map key enum type. (Optional) The type used in mapping a map key enum type. Default value: javax.persistence.EnumType.ORDINAL Since: JPA 2.0

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support