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 mean it obeys the JDO API. Since the "id" for a datastore-identity case as input to pm.newObjectIdInstance has to be the toString() form of the datastore id class then that is to be expected (that you would get back from calling pm.getObjectId()).

I understand.  So is my approach the "correct" way of retrieving an object from the datastore (rdbms) by it's id (the sequence id that was generated)?  Or is there a better approach to accomplish this?  Should I be using the DN DatastoreId implementation class directly as in my snippet above?

I'm a bit surprised that Kodo allowed me to do this by Long ID only if that is part of the JDO spec.  

Thanks,

Eric

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