Re: Application identity ("custom keys") might be breaking queries for inheritance classes


Andy
 
Edited

Hi,

Take a step backwards. How do you think DataNucleus knows how to persist a field of type `Key`? It doesn't, unless you tell it. You don't define that as an "objectIdClass" for that persistable class, and you don't define an `@AttributeConverter` for that `Key` type, so it knows not. Defining an `@AttributeConverter` to convert `Key` to String would be the normal way of handling that. Inheritance has nothing to do with that.

I also don't see any reference to the LOG which tells you what MongoDB query it performs for your `getObjectById` call, or indeed what MongoDB call is made to do the INSERT of the object in the first place. They would likely reveal what it is trying to do with it.

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