Skip to content

Commit

Permalink
Allow datastore id with input of a numeric being the key object. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjefferson committed Mar 12, 2021
1 parent ce95e3b commit e3414d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/datanucleus/ExecutionContextImpl.java
Expand Up @@ -3834,6 +3834,11 @@ else if (key instanceof java.lang.String)
id = nucCtx.getIdentityManager().getDatastoreId((String)key);
}
}
else if (cmd.getIdentityType() == IdentityType.DATASTORE && (key instanceof Number))
{
// Assume that the user called newObjectId passing in a numeric surrogate field value
id = nucCtx.getIdentityManager().getDatastoreId(pcClass.getName(), key);
}
else
{
// Key is not a string, and is not SingleFieldIdentity
Expand Down

0 comments on commit e3414d1

Please sign in to comment.