Community
Participate
Working Groups
When trying to insert an array with zero elements into an array column in the database, a NULL value is written instead. This is wrong since NULL is fundamentally different from an empty array. Moreover it triggers bug #537657. The bug seems to be in org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping.writeFromObjectIntoRow(Object, AbstractRecord, AbstractSession, WriteType) which doesn't handle the case of an empty collection correctly. Steps to reproduce (with PostgreSQL): CREATE TABLE foo ( bar TEXT ARRAY NOT NULL ) -- @Entity @Struct(name = "foo") public class Foo { @Column @Array(databaseType = "bar") List<String> bar = Collections.emptyList(); } -- EntityManager.persist(new Foo());
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink