Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/2.4/a array"

m
Line 4: Line 4:
 
|category=JPA
 
|category=JPA
 
|release=2.4.x
 
|release=2.4.x
|title= }}
+
|title=TLJPA }}
 
<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" |   
| width="144" align="right" valign="bottom" |
+
| width="185" align="right" valign="bottom" |
 
{| class="simple oac_no_warn" width="100%"
 
{| class="simple oac_no_warn" width="100%"
 
|
 
|
 
| align="center" valign="top" |
 
| align="center" valign="top" |
[http://www.google.com/cse/home?cx=016171230611334810008:y5kxq4rqd8s&hl=en Search]
+
[[Image:Elug_Magnifier.png|Search]][http://www.google.com/cse/home?cx=016171230611334810008:y5kxq4rqd8s&hl=en Search]
 
| align="center" valign="top" |
 
| align="center" valign="top" |
[[EclipseLink/UserGuide/JPA/toc| Contents]]
+
&nbsp;&nbsp;&nbsp;[[Image:Elug_guide_icon.png|Contents]][[EclipseLink/UserGuide/JPA/2.4/toc| Contents]]
 
|}
 
|}
 
|}
 
|}
Line 21: Line 21:
 
----
 
----
  
{| width="150"
+
{| width="165"
 
| align="center" |
 
| align="center" |
[[EclipseLink/UserGuide/JPA/a_additionalcriteria|&lt;- Previous]]
+
[[EclipseLink/UserGuide/JPA/2.4/a_additionalcriteria| Previous ]]<span class="previouslink">[[Image:Elug_previous_icon.png|Previous]]</span>
 
| align="center" |
 
| align="center" |
[[EclipseLink/UserGuide/JPA/a_batchfetch|Next -&gt;]]
+
[[EclipseLink/UserGuide/JPA/2.4/a_batchfetch| Next ]][[Image:Elug_next_icon.png|Next]]
 
|
 
|
 
|}
 
|}
Line 43: Line 43:
 
===Annotation Elements===
 
===Annotation Elements===
  
[[#CBABBAJF|Table 2-1]] describes this annotation's elements.
+
[[#CBABBAJF|Table 2-2]] describes this annotation's elements.
  
 
<span id="sthref21"></span><span id="CBABBAJF"></span>
 
<span id="sthref21"></span><span id="CBABBAJF"></span>
  
'''''Table 2-1 @Array Annotation Elements'''''
+
'''''Table 2-2 @Array Annotation Elements'''''
  
 
{| class="HRuleFormalWide" dir="ltr" title="@Array Annotation Elements" summary="This table describes the list of attributes for this annotation." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows"
 
{| class="HRuleFormalWide" dir="ltr" title="@Array Annotation Elements" summary="This table describes the list of attributes for this annotation." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows"
 
|- align="left" valign="top"
 
|- align="left" valign="top"
! id="r1c1-t2" align="left" valign="bottom" | '''Annotation Element'''
+
! id="r1c1-t5" align="left" valign="bottom" | '''Annotation Element'''
! id="r1c2-t2" align="left" valign="bottom" | '''Description'''
+
! id="r1c2-t5" align="left" valign="bottom" | '''Description'''
! id="r1c3-t2" align="left" valign="bottom" | '''Default'''
+
! id="r1c3-t5" align="left" valign="bottom" | '''Default'''
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| id="r2c1-t2" headers="r1c1-t2" align="left" |
+
| id="r2c1-t5" headers="r1c1-t5" align="left" |
 
<code>databaseType</code>
 
<code>databaseType</code>
| headers="r2c1-t2 r1c2-t2" align="left" |
+
| headers="r2c1-t5 r1c2-t5" align="left" |
 
(Required) The name of the database array structure type.
 
(Required) The name of the database array structure type.
| headers="r2c1-t2 r1c3-t2" align="left" | <br />
+
| headers="r2c1-t5 r1c3-t5" align="left" | <br />
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| id="r3c1-t2" headers="r1c1-t2" align="left" |
+
| id="r3c1-t5" headers="r1c1-t5" align="left" |
 
<code>targetClass</code>
 
<code>targetClass</code>
| headers="r3c1-t2 r1c2-t2" align="left" |
+
| headers="r3c1-t5 r1c2-t5" align="left" |
 
(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.
 
(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.
| headers="r3c1-t2 r1c3-t2" align="left" |
+
| headers="r3c1-t5 r1c3-t5" align="left" |
 
Parameterized type of the collection.
 
Parameterized type of the collection.
 
|}
 
|}
Line 85: Line 85:
 
===Examples===
 
===Examples===
  
<span id="sthref24"></span>
+
[[#CBABHEHD|Example 2-5]] shows how to use this annotation with an Oracle <code>VARRAY</code> type.
  
'''''Example 2-1 Using @Array with Oracle VARRAY'''''
+
<span id="CBABHEHD"></span>
 +
 
 +
'''''Example 2-5 Using @Array with Oracle VARRAY'''''
  
 +
 
   
 
   
  
<span id="sthref25"></span>
+
[[#CBACGBDA|Example 2-6]] shows how to use this annotation with an Postgress <code>Struct</code> type.
  
'''''Example 2-2 Using @Array with Postgress Struct'''''
+
<span id="CBACGBDA"></span>
 +
 
 +
'''''Example 2-6 Using @Array with Postgress Struct'''''
  
 +
 
   
 
   
  
<span id="sthref26"></span>
+
<span id="sthref24"></span>
  
 
''' '''
 
''' '''
Line 105: Line 111:
 
For more information, see the following:
 
For more information, see the following:
  
* [[EclipseLink/UserGuide/JPA/a_struct|"@Struct"]]
+
* [[EclipseLink/UserGuide/JPA/2.4/a_struct|"@Struct"]]
 +
 
 +
<span id="footerspace"> </span>
  
 
----
 
----
Line 112: Line 120:
 
|-
 
|-
 
| valign="bottom" |
 
| valign="bottom" |
{| width="150"
+
{| width="165"
 
|-
 
|-
 
|
 
|
 
| align="center" |
 
| align="center" |
[[EclipseLink/UserGuide/JPA/a_additionalcriteria|&lt;- Previous]]
+
[[EclipseLink/UserGuide/JPA/2.4/a_additionalcriteria| Previous ]]<span class="previouslink">[[Image:Elug_previous_icon.png|Previous]]</span>
 
| align="center" |
 
| align="center" |
[[EclipseLink/UserGuide/JPA/a_batchfetch|Next -&gt;]]
+
[[EclipseLink/UserGuide/JPA/2.4/a_batchfetch| Next ]][[Image:Elug_next_icon.png|Next]]
 
|}
 
|}
 
| width="34%" align="center" |
 
| width="34%" align="center" |
[[Image:Eclipselink-logo.gif|150px|EclispeLink]]<br />[http://wiki.eclipse.org/EclipseLink EclipseLink Home]<br />
+
[[Image:Eclipselink-logo.gif|150px|EclispeLink]]<br />[[Image:Elug_home_icon.png|EclipseLink logo]] [http://www.eclipse.org/eclipselink/ EclipseLink Home] • [[Image:Elug_pdf.png|PDF]] PDF (coming soon)<br />
 
| align="right" valign="bottom" |
 
| align="right" valign="bottom" |
 
{| class="simple oac_no_warn" width="225"
 
{| class="simple oac_no_warn" width="225"
 
|
 
|
 
| align="center" valign="top" |
 
| align="center" valign="top" |
[http://www.google.com/cse/home?cx=016171230611334810008:y5kxq4rqd8s&hl=en Search]
+
[[Image:Elug_Magnifier.png|Search]][http://www.google.com/cse/home?cx=016171230611334810008:y5kxq4rqd8s&hl=en Search]
 
| align="center" valign="top" |
 
| align="center" valign="top" |
[[EclipseLink/UserGuide/JPA/toc| Contents]]
+
&nbsp;&nbsp;&nbsp;[[Image:Elug_guide_icon.png|Contents]][[EclipseLink/UserGuide/JPA/2.4/toc| Contents]]
 
|}
 
|}
 
|}
 
|}

Revision as of 10:19, 18 June 2012


Java Persistence API (JPA) Extensions Reference for EclipseLink, 2.4.x

SearchSearch

   Contents Contents


Previous Previous

Next Next


@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-2 describes this annotation's elements.

Table 2-2 @Array Annotation Elements

Annotation Element Description Default

databaseType

(Required) The name of the database array structure type.


targetClass

(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-5 shows how to use this annotation with an Oracle VARRAY type.

Example 2-5 Using @Array with Oracle VARRAY



Example 2-6 shows how to use this annotation with an Postgress Struct type.

Example 2-6 Using @Array with Postgress Struct



See Also

For more information, see the following:

 


Previous Previous

Next Next

EclispeLink
EclipseLink logo EclipseLink Home • PDF PDF (coming soon)

SearchSearch

   Contents Contents

Back to the top