Re: Trouble understanding how to lookup objects that have a Datastore Identity by their PK (if the PK is not identified in the model)


ebenzacar@...
 

You could do something like
MyClass myObj = pm.getObjectById(MyClass.class, theIdValue);
This would likely work whether you are using (single-field) application identity OR datastore identity. And you don't need to cast anything ...


Works perfectly.  Didn't realize that the solution was that straightfoward.  I had understood from the javadoc that the `theIdValue` had to be an Identity object.

Thanks,

Eric

Join main@datanucleus.groups.io to automatically receive all group messages.