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.
Difference between revisions of "EclipseLink/UserGuide/JPA/2.4/a array"
m (New page: {{EclipseLink_TLJPA |info=n |toc=n |category=JPA |release=2.4.x}} <span class="metaname"> </span> {| class="simple oac_no_warn" width="100%" | align="left" valign="top" | '''EclipseL...) |
m |
||
Line 4: | Line 4: | ||
|category=JPA | |category=JPA | ||
|release=2.4.x}} | |release=2.4.x}} | ||
− | |||
<span class="metaname"> </span> | <span class="metaname"> </span> | ||
{| class="simple oac_no_warn" width="100%" | {| class="simple oac_no_warn" width="100%" | ||
− | | align="left" valign="top" | ''' | + | | align="left" valign="top" | '''Java Persistence API (JPA) Extensions Reference for EclipseLink'''<br />'''Version 2.4.x'''<br /> |
| width="144" align="right" valign="bottom" | | | width="144" align="right" valign="bottom" | | ||
{| class="simple oac_no_warn" width="100%" | {| class="simple oac_no_warn" width="100%" | ||
Line 37: | Line 36: | ||
Use <code>@Array</code> to define object-relational data types supported by specific databases, such as Oracle <code>VARRAY</code> types or PostgreSQL <code>JDBC Struct</code> types. | Use <code>@Array</code> to define object-relational data types supported by specific databases, such as Oracle <code>VARRAY</code> types or PostgreSQL <code>JDBC Struct</code> types. | ||
− | <span id=" | + | <span id="sthref20"></span> |
''' ''' | ''' ''' | ||
Line 45: | Line 44: | ||
[[#CBABBAJF|Table 2-1]] describes this annotation's elements. | [[#CBABBAJF|Table 2-1]] describes this annotation's elements. | ||
− | <span id=" | + | <span id="sthref21"></span><span id="CBABBAJF"></span> |
'''''Table 2-1 @Array Annotation Elements''''' | '''''Table 2-1 @Array Annotation Elements''''' | ||
Line 71: | Line 70: | ||
<br /> | <br /> | ||
− | <span id=" | + | <span id="sthref22"></span> |
''' ''' | ''' ''' | ||
Line 79: | Line 78: | ||
Use <code>@Array</code> on a collection attribute that is persisted to an <code>Array</code> type. The collection can be of basic types or embeddable class mapped using a <code>Struct</code>. | Use <code>@Array</code> on a collection attribute that is persisted to an <code>Array</code> type. The collection can be of basic types or embeddable class mapped using a <code>Struct</code>. | ||
− | <span id=" | + | <span id="sthref23"></span> |
''' ''' | ''' ''' | ||
Line 85: | Line 84: | ||
===Examples=== | ===Examples=== | ||
− | <span id=" | + | <span id="sthref24"></span> |
'''''Example 2-1 Using @Array with Oracle VARRAY''''' | '''''Example 2-1 Using @Array with Oracle VARRAY''''' | ||
Line 91: | Line 90: | ||
− | <span id=" | + | <span id="sthref25"></span> |
'''''Example 2-2 Using @Array with Postgress Struct''''' | '''''Example 2-2 Using @Array with Postgress Struct''''' | ||
Line 97: | Line 96: | ||
− | <span id=" | + | <span id="sthref26"></span> |
''' ''' | ''' ''' | ||
Line 105: | Line 104: | ||
For more information, see the following: | For more information, see the following: | ||
− | * [[ | + | * [[EclipseLink/UserGuide/JPA/a_struct|"@Struct"]] |
---- | ---- |
Revision as of 09:49, 7 June 2012
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:
|
|