users@glassfish.java.net

Re: _at_GeneratedValue(strategy = GenerationType.AUTO) throws exception

From: <glassfish_at_javadesktop.org>
Date: Tue, 04 Sep 2007 16:46:49 PDT

Well, the id type is "long" (bigint(20) in database). I am running a loop to create the instances (lets say, 10 to 20 instances).

for(int i=0; i<20; i++) {
  createing new object;
  em.persist();
}

[and then deleting records as well]
em.createNativeQuery ("DELETE FROM table WHERE column2 > 100").executeUpdate();
[Message sent by forum member 'server_user' (server_user)]

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