1. MySql problems using GenerationType.IDENTITY annotation forum.hibernate.orgHi there Im having problems mapping a table to my MySql DB. Im learning to use JPA , so im doing the "HelloWorld" exercises on the chapter 2 of the Book "Java Persistence with Hibernate". My field "id" from the Message.java file, is intent to be auto-increment, so i used the follow annotation: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) that produces this sql line by ... |
2. GenerationType.IDENTITY annotation - MySql problems forum.hibernate.orgHi there Im having problems mapping a table to my MySql DB. Im learning to use JPA , so im doing the "HelloWorld" exercises on the chapter 2 of the Book "Java Persistence with Hibernate". My field "id" from the Message.java file, is intent to be auto-increment, so i used the follow annotation: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) that produces this sql line by ... |
3. Generating ID using GenerationType.TABLE and MySQL forum.hibernate.orgERROR: could not read or init a hi value com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key = 'value' for update' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ... |