Java Hibernate id auto increment
Posted
by
vinise
on Stack Overflow
See other posts from Stack Overflow
or by vinise
Published on 2011-01-02T10:51:14Z
Indexed on
2011/01/02
10:53 UTC
Read the original article
Hit count: 245
Hy
I'v a little problem with hibernate on netbeans. I've a table with an Auto increment id :
CREATE TABLE "DVD"
(
"DVD_ID" INT not null primary key
GENERATED ALWAYS AS IDENTITY
(START WITH 1, INCREMENT BY 1),
"TITLE" VARCHAR(150),
"COM" LONG VARCHAR,
"COVER" VARCHAR(150)
);
But this auto increment is not properly detected with Reverse Engineering. I get a map file with this :
<id name="dvdId" type="int">
<column name="DVD_ID" />
<generator class="assigned" />
</id>
i've looked on google and on this site ... foud some stuf but i'm still stuck..
i've tried to add insert="false" update="false" on the map file but i get back :
Caused by: org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "id".
Anny help will be pleased
Vincent
© Stack Overflow or respective owner