Spring @GeneratedValue annotations not working for Auto increment field
<p>I use Scaffolding in MyEclipse to generate Web Application project, using spring MVC and MySQL database. Please give me some clues to solve problem bellow. </p>

<p>I get problem with id primary key. It doesn't auto increment event if i use: 
<em>@GeneratedValue(strategy=GenerationType.IDENTITY)
@GeneratedValue(strategy=GenerationType.AUTO)
@GeneratedValue(strategy=GenerationType.SEQUENCE)
@GeneratedValue(strategy=GenerationType.TABLE)</em></p>

<p>I have several tables with the primary key set to AUTO_INCREMENT. Like this example:</p>

<pre><code>CREATE TABLE IF NOT EXISTS `ehealthdb`.`timestamp` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '',
  `login_date` DATETIME NULL COMMENT '',
  `logout_date` DATETIME NULL COMMENT '',
  `create_date` DATETIME NOT NULL COMMENT '',
  `update_date` DATETIME NULL COMMENT '',
  `isActive` TINYINT(1) NULL COMMENT '',
  PRIMARY KEY (`id`)  COMMENT '')
ENGINE = InnoDB;
</code></pre>

<p>When I try to use the save using the generated post URL and the following json payload:</p>

<pre><code>{
 "loginDate":"1374839856000",
 "logoutDate":"1374839856000",
 "createDate":"1374839856000",
 "updateDate":"1374839856000",
 "isActive":true
}
</code></pre>

<blockquote>
  <p><em>Request processing failed; nested exception is javax.persistence.PersistenceException:
  org.hibernate.id.IdentifierGenerationException: ids for this class
  must be manually assigned before calling save():
  ehealth.domain.Timestamp</em></p>
</blockquote>

<p>I think this is caused by a missing @GeneratedValue, which scaffolding has not created on my primary keys. I had to add it in manually like below:</p>

<p>But It's still not work. It's still get error. </p>

<pre><code>@Id
@GeneratedValue(strategy=GenerationType.IDENTITY) //add this 
@Column(name = "id", unique = true, nullable = false)
@Basic(fetch = FetchType.EAGER)

@XmlElement
Integer id;
</code></pre>