users@glassfish.java.net

Re: MySQLIntegrityConstraintViolationException - on load...any suggestion??

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Nov 2007 18:40:44 PST

I have used @GeneratedValue(strategy = GenerationType.IDENTITY) but it throws 'id' not defined exception while inserting data. I have chaged mysql table structure manually by adding "AUTO_INCREMENT" property and it's working fine without specifying any ID generation strategy.

Looks like IDENTITY does not store max current ID in a table, as does the SEQUENCE. However, just wondering what is the best way of using IDENTITY. How can I set initial ID if I use IDENTITY.

cheers.
[Message sent by forum member 'server_user' (server_user)]

http://forums.java.net/jive/thread.jspa?messageID=244444