[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] NPE when updating entity where only @Element-collection has changed
|
Hi all.
I'm using EL-2.5.2 with PostgreSQL
I have one entity where the only field changed is an @ElementCollection, this results in the following code-path:
SQLUpdateStatement.buildCallWithoutReturning, line 64:
if (fieldsForTable.isEmpty()) {
return null;
}
Then null is returned and assigned to the sqlCall-variable in SQLModifyStatement.buildCall:
public DatabaseCall buildCall(AbstractSession session) {
SQLCall sqlCall = buildCallWithoutReturning(session); // null is returned here
if ((getReturnFields() == null) || getReturnFields().isEmpty()) {
return sqlCall;
} else {
return session.getPlatform().buildCallWithReturning(sqlCall, getReturnFields());
}
}
Using the PostgreSQLPlatform, this is what happens:
public DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields) {
SQLCall call = new SQLCall();
call.setParameters(sqlCall.getParameters()); // BOOM NPE !!!!!!!!!!
Has anyone else seen or been bitten by this?
Thanks.
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963