-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: why i can only use uuid.hex generator?
PostPosted: Tue Oct 05, 2004 12:26 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
my database is mysql,my code works fine only when i set the gererator=uuid.hex in the mapping file,if i set native or identity,i will get error like this:
Code:
net.sf.hibernate.HibernateException: The database returned no natively generated identity value

please give me a hint,thx :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 05, 2004 2:11 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Guess your id column isn't set to autoincrement.

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 12:26 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
yes,i didn't do that,could tell me how to set autoincrement in mysql?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 2:22 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
An example stolen from an other post

Code:
create table reservations (
   id BIGINT NOT NULL AUTO_INCREMENT,
   book_id VARCHAR(25),
   date_made DATE,
   member_id VARCHAR(20),
   remarks VARCHAR(255),
   limit_in_days INTEGER,
   primary key (id)
);


HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2004 4:36 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
i recreate the table,but i still got this error :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.