Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Re: Postgres arrays

I seem to have worked out my issues. I upgraded the jdbc driver from postgresql-8.2-506.jdbc3.jar to postgresql-8.4-701.jdbc4.jar and postgres now returns the boxed types instead of the primitive arrays.

mike

Mike Traum wrote:
Hi,
I'm trying to get a mapping for postgres arrays working. I'm using a Converter and thus far (without a lot of testing), inserting an array seems to work fine. But, when reading that array, eclipselink (1.2) throws the following exception before we even get to the Converter:
java.lang.ClassCastException: [D cannot be cast to [Ljava.lang.Object;
at org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor.buildArrayObjectFromArray(ObjectRelationalDataTypeDescriptor.java:326)
...

The problem seems to be that eclipselink is attempting to cast java.sql.Array.getArray() to Object[], but postgres returns an array of primitives. This seems like an eclipselink bug, no? Any idea for a workaround?

Thanks,
Mike




Back to the top