Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Trupti Patil   on Dec 24 In Java Category.

  
Question Answered By: Faiza Mian   on Dec 24

Look at your database  table description  (in MySQL use command "desc TABLE_NAME") and see if its "id" column is "auto_increment"?
If not, modify (alter) your table and make id column auto_increment.

Then in your entity add this annotation to id property:
@GeneratedValue(strategy=GenerationType.AUTO)

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on toplink/jpa problem Or get search suggestion and latest updates.


Tagged: