Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Entity Update throws NPE for @ElementColection of Map - Eclipselink 2.5.2
Entity Update throws NPE for @ElementColection of Map - Eclipselink 2.5.2 [message #1706765] Sun, 30 August 2015 18:54 Go to next message
Ashok Shan is currently offline Ashok ShanFriend
Messages: 4
Registered: August 2015
Junior Member
I have Department and Employee Entities. Employee table has three columns: DEPARTMENT_ID, KEY, VALUE. Inserted the null value in my insert for non null key in the Employee table. I received NullPOinterException during my update with non null value for exisiting key during prop.put(key, value);

at java.util.Hashtable.put(
at org.eclipse.persistence.indirection.IndirectMap.put(
at org.eclipse.persistence.internal.queries.MapContainerPolicy.addInto(
at org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy.addInto(
at org.eclipse.persistence.queries.DataReadQuery.executeNonCursor(
at org.eclipse.persistence.queries.DataReadQuery.executeDatabaseQuery(
at org.eclipse.persistence.queries.DatabaseQuery.execute(
at org.eclipse.persistence.queries.DataReadQuery.execute(
at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(
at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(
at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(
at org.eclipse.persistence.indirection.IndirectMap.buildDelegate(
at org.eclipse.persistence.indirection.IndirectMap.getDelegate(
at org.eclipse.persistence.indirection.IndirectMap.put(

EclipseLink version is 2.5.2

I have Department and Employee Entities and Department Entity class has the following relationship with Employee Entity.

@Table(name = "DEPARTMENT" uniqueConstraints = {
@UniqueConstraint(columnNames = { "NAME" }) })
@NamedQueries( {
@NamedQuery(name = Department.findAll", query = "select d from Department d"),
@NamedQuery(name = Department.findByName", query = "select d from Department d WHERE = :name")})

public class Department implements Serializable {

@MapKeyColumn( name = "KEY")
@Column( name = "VALUE")
@CollectionTable(name="DEPARTMENT_PROP", joinColumns = @joinColumn(name= "DEPARTMENT_ID))
private final Map<String, String> props = new HashMap();

public Map<String, String> getProperties() {
return properties;

Re: Entity Update throws NPE for @ElementColection of Map - Eclipselink 2.5.2 [message #1707420 is a reply to message #1706765] Fri, 04 September 2015 15:24 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
EclipseLink uses hashTables and does not allow for null keys or values.
Previous Topic:Hung threads
Next Topic:Getting a naming exception for a DataSource that I can find programatically
Goto Forum:

Current Time: Wed Feb 21 04:03:32 GMT 2024

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

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

Back to the top