-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate is Messing with my primary keys.
PostPosted: Fri Apr 16, 2004 10:15 pm 
Newbie

Joined: Thu Apr 01, 2004 6:28 pm
Posts: 15
uuid.hex is Biggest crp out there, it fills your primary keys with
HUGE strings. I want to set my primary keys as Integers and make them as SEQUENCE on postgres, thats a problem to do. The problem is to tell hibernate that he doesnt need to map the field, but if I dont do that how will a NOT NULL field be left with nothing when a SAVE a new row?
I not sure im being clear, I want to add new rows on ejbs without setting any value on the pk, not even mapping it, but making them go in sequence on postgres, any idea how?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 11:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
I not sure im being clear


I am sure you are not being clear. In addition, I am not sure you're being polite.

Please take the time to read the documentation before you post again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 11:09 pm 
Newbie

Joined: Thu Apr 01, 2004 6:28 pm
Posts: 15
seriously, I just want to have an AUTO_INCREMENT
field as my pk, puttin on hibernate generator class as increment gives me erros 'could not load class'


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 11:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Seriously, read the documentation!

It is "native" that enables use of AUTO_INCREMENT keys in MySQL, not "increment".


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 8:26 am 
Newbie

Joined: Thu Apr 01, 2004 6:28 pm
Posts: 15
i use postgres!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 8:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
um.

To the best of my knowledge, there is no such thing as AUTO_INCREMENT in Postgres.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 6:55 pm 
Expert
Expert

Joined: Thu Jan 08, 2004 6:17 pm
Posts: 278
Why aren't you just doing

Code:
        <id name="id" type="long" unsaved-value="null" >
            <generator class="sequence"/>
        </id>


??????????

Cheers!
Rob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.