Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @Array doesn't seem to support basic types
@Array doesn't seem to support basic types [message #734591] Sat, 08 October 2011 19:34 Go to next message
Lucas Madar is currently offline Lucas MadarFriend
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?
Re: @Array doesn't seem to support basic types [message #735393 is a reply to message #734591] Tue, 11 October 2011 15:21 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
Please log a bug for this, the current support supports object-relational data-types only in object-relational data-type descriptors. i.e. you need an @Struct in the Test class.

What database are you using?


--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: @Array doesn't seem to support basic types [message #743812 is a reply to message #735393] Fri, 21 October 2011 18:57 Go to previous message
Lucas Madar is currently offline Lucas MadarFriend
Messages: 2
Registered: October 2011
Location: Portland, Oregon
Junior Member
Okay, thanks for letting me know; I am using Postgresql.

As a workaround, since I am only reading the data for the time being, I am reading it as a string and parsing the string value manually.

I have submitted this as bug 361701, "@Array annotation does not support basic types," priority normal.
Re: @Array doesn't seem to support basic types [message #743813 is a reply to message #735393] Fri, 21 October 2011 18:57 Go to previous message
Lucas Madar is currently offline Lucas MadarFriend
Messages: 3
Registered: July 2009
Junior Member
Okay, thanks for letting me know; I am using Postgresql.

As a workaround, since I am only reading the data for the time being, I am reading it as a string and parsing the string value manually.

I have submitted this as bug 361701, "@Array annotation does not support basic types," priority normal.
Previous Topic:DescriptorQueryManager+EntityManager
Next Topic:create-tables doesn't create foreign key constraints
Goto Forum:
  


Current Time: Thu Mar 28 16:24:03 GMT 2024

Powered by FUDForum. Page generated in 0.02734 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top