@Array doesn't seem to support basic types [message #734591] |
Sat, 08 October 2011 19:34 |
Lucas Madar Messages: 2 Registered: October 2011 Location: Portland, Oregon |
Junior Member |
|
|
Disclaimer: I'm new to eclipselink, so I may just be doing something horribly wrong.
I'm trying to use the @Array annotation that appears to be new in Eclipselink 2.3 to map a collection of Integers to a single table column. Unfortunately, I am not responsible for this database design and am unable to change it.
Here's my basic test structure:
@Entity
@Table( name = "testarray" )
public class Test {
@Id
@Column ( name = "testarrayid" )
private long id;
@Array( databaseType="INTEGER[]" )
@Column( name = "value" )
private List<Integer> value;
...
}
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).
I see no way that this could actually work. Is this a bug in EclipseLink, or am I doing something wrong?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01790 seconds