Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Auto Generator in composite key

 
Sakthi Ramasamy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please let me know how to make the CAMPAIGN_ID in the composite key to be auto generated [Sequence starting from 1000 and thereby incremented by 1]. I have a MySQL query for Sequence generation.

The problem is, whenever i create a campaign, after 2, its getting updated instead of insert. Is it because of hbm files or is it because of some session updation in java code.

I couldn't come to conclusion why it is behaving so.




Thanks in advance for your time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic