Starting a new project I'd like to use Hibernate annotations with MySQL instead of the configuration files I've used so far. And I can't seem to find the equivalent of:
<id name="id" type="long" >
<generator class="native"></generator>
</id>
I tried using:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "native")
private long id;
but got:
org.hibernate.AnnotationException: Unknown Id.generator: native
or:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
Give me:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE projectName.identity does not exist
Does anyone successfully deployed MySQL and Hibernate3 annotations for automatically generating ids?