Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/UserGuide/JPA/2.4/a array
Java Persistence API (JPA) Extensions Reference for EclipseLink Version 2.4.x |
|
@Array
Use @Array
to define object-relational data types supported by specific databases, such as Oracle VARRAY
types or PostgreSQL JDBC Struct
types.
Annotation Elements
Table 2-1 describes this annotation's elements.
Table 2-1 @Array Annotation Elements
Annotation Element | Description | Default |
---|---|---|
|
(Required) The name of the database array structure type. |
|
|
(Optional only if the collection field or property is defined using Java generics; otherwise Required) The class (basic or embeddable) that is the element type of the collection. |
Parameterized type of the collection. |
Usage
Use @Array
on a collection attribute that is persisted to an Array
type. The collection can be of basic types or embeddable class mapped using a Struct
.
Examples
Example 2-1 Using @Array with Oracle VARRAY
Example 2-2 Using @Array with Postgress Struct
See Also
For more information, see the following:
|
|