Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361701

Summary: Update @Array annotation to support PostGreSQL integer[] type or provide an alternate way to configure that type of column
Product: z_Archived Reporter: Lucas Madar <lucas.madar>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: REOPENED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: araistari, damiano.albani, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lucas Madar CLA 2011-10-21 14:54:18 EDT
It appears that the @Array annotation added in 2.3 only works for object-relational datatypes (structs).

Given the following snippet:

@Array
@Column( name = "VALUE" )
List<Integer> values;

This appears to create an ArrayMapping, which is desired, and it passes the values down to line 752 of AbstractCompositeDirectCollectionMapping, where it calls getDescriptor().buildFieldValueFromDirectValues(). However, the descriptor is of type RelationalDescriptor, which throws an exception when this is called (DescriptorException.normalDescriptorsDoNotSupportNonRelationalExtensions).
Comment 1 Tom Ware CLA 2011-10-21 15:10:46 EDT
@Array is designed for ObjectRelational types.

Depending on what you are trying to do here, you may want to file an enhancement request requesting the functionality you are looking for.
Comment 2 Lucas Madar CLA 2011-10-21 15:25:36 EDT
Essentially, I have a table column that is an array of integers. (This is in postgresql, by the way, using integer[] as a column type).

From the code comments in the @Array class:
"Arrays can contains [sic] basic types (VARCHAR) or other Struct types, and can be stored in a column or in a Struct type."

So, either that documentation is incorrect, it is specific to Oracle, or it is not implemented as stated.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:23:30 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink