users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Nov 2007 06:56:30 PST

The intent of using IDENTITY is to let the server generate your values. And yes you need to have the table use auto_increment on mysql (identity on other databases) for GenerationType.Identity.

When you create the table, you can use auto_increment=100 (for example) so you start your values from 100 on inserts vs 1.

The value is stored internally as part of the table Structure. Sybase for example used to store it on the Tables OAM page. Not sure where it is stored on MySQL (have not had a reason to look yet).


Regards
lance
[Message sent by forum member 'lancea' (lancea)]

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