Is there a way to define a default sequence generator to use for all classes for Datastore-Identity instead of doing it on a per-class basis?


ebenzacar@...
 

I've been reading through the docs for using native sequences for datastore-identities (https://www.datanucleus.org/products/accessplatform_5_0/jdo/mapping.html#valuegen_sequence).  But from what I can tell, I need to expressly identify for each persisted class that I want to use a sequence, and the name of the sequence I want to use.

If I want to use a single sequence for all my objects, is there a way to specify at the persistence manager level a default sequence generator to use instead?  I tried looking through all the pmf properties (https://www.datanucleus.org/products/accessplatform/jdo/persistence.html#pmf_properties) but couldn't find anything appropriate.

Is my only choice to manually annotate each class and hope no one forgets in the future?

Thanks,

Eric


Andy
 

You can create a single sequence, and then specify on each class that you want to use it against whichever classes. There is no "apply this to everything unless told otherwise" option.

Why you would want to use a single sequence for many disparate classes is your issue.