Fix for #260 - Trying to insert() or save() an entity with no @Id results in NPE

This commit is contained in:
rbygrave committed 2015-04-11 19:16:36 +12:00
1 parent 3b30388b35
commit cb6faa022b
3 files changed
+78 -3

No files matched your search

@@ -67,10 +67,16 @@ public final class InsertMeta {
} else {
// insert sql for db identity or sequence insert
this.concatinatedKey = false;
this.identityDbColumns = new String[]{id.getIdentityColumn()};
if (id.getIdentityColumn() == null) {
this.identityDbColumns = new String[]{};
this.supportsGetGeneratedKeys = false;
this.selectLastInsertedId = null;
} else {
this.identityDbColumns = new String[]{id.getIdentityColumn()};
this.supportsGetGeneratedKeys = dbPlatform.getDbIdentity().isSupportsGetGeneratedKeys();
this.selectLastInsertedId = desc.getSelectLastInsertedId();
}
this.sqlNullId = genSql(true);
this.supportsGetGeneratedKeys = dbPlatform.getDbIdentity().isSupportsGetGeneratedKeys();
this.selectLastInsertedId = desc.getSelectLastInsertedId();
}
}