In older version of TopLink Essentials both SEQUENCE and IDENTITY used to define IDENTITY on PostgreSQLPlatform.
It looks like your table defined using Identity (SERIAL). It uses sequence named tableName_IdName_seq to populate pk field.
Now TopLinkEssentials supports both SEQUENCE and IDENTITY, so GenerationType.SEQUENCE results in using default preallocation size (50).
TopLinkEssential thinks that it acquires values in chunks of 50; so the first value to use would be (newlyAcquiredValue - 49).
To fix instead of:
@SequenceGenerator(name = "STATS_SEQ_GEN", sequenceName = "stats_id_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE,
generator = "STATS_SEQ_GEN")
use:
@GeneratedValue(strategy = GenerationType.IDENTITY)
That will work with older TopLinkEssentials, too.
[Message sent by forum member 'ailitche' (ailitche)]
http://forums.java.net/jive/thread.jspa?messageID=347070