0

I am using java,Datanucleus,mongodb and JDO in my project.

I have a requirement where I should generate sequence number and store it in DB. I was going through various links and found that DataNucleus supports the automatic assignment of sequence values for object identities only for the following datastore:-

Oracle
PostgreSQL
SAP DB
DB2
Firebird
HSQLDB
H2
Derby (from v10.6)
DB4O

So does that mean -> sequence generation can't be done for mongoDB? If it can be then please provide some useful link or guidance !

Note:I am already aware of the fact that mongoDB creates an object id on its own..but I want custom sequence number generation,store it in DB and use it.

Abhinav
  • 1,720
  • 4
  • 21
  • 33

1 Answers1

0

DataNucleus-MongoDB supports "INCREMENT" value strategy, as stated very clearly in the docs, and additionally supports many other strategies.

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
  • thanks..i got it..but is it possible to write custom class to generate "INCREMENT" like its done for sequence in datanucleus?If yes please provide any relevant resource link.. – Abhinav Dec 07 '12 at 08:35
  • INCREMENT is defined in the JDO spec as being provided by the JDO implementation, not by some custom classes. – DataNucleus May 28 '13 at 12:30