Unique number generating in Java Mapping
I'm working on a mapping and in some cases (when Object ID is missing) I need to generate a unique number. But this can't be genereted as a timestamp but from a sequence. This sequence must start at 10000 and be increased by 1 every time a number is needed. I could use a Container or Global container for this, but how to initialize it for the 1st time, so it starts at 10000. And I need to ensure the same number will not be repeated again.
Can you please help me how to resolve this?