-->
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.  [ 6 posts ] 
Author Message
 Post subject: 'hibernate_sequence'
PostPosted: Fri Apr 23, 2004 10:26 pm 
Newbie

Joined: Thu Apr 01, 2004 6:28 pm
Posts: 15
Is there any way to use another sequence instead of ONLY ONE?
I have multiple tables and they all need differente sequence types, why I'm allowed only to use this? why I cant map my existing sequences????????????


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 10:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The way to do things in Hibernate is to read documentation, including JavaDoc, not write silly forum posts with hundreds of question marks.

Code:
<para name="sequence">MY_SEQUENCE</param>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 1:10 pm 
Newbie

Joined: Thu Apr 01, 2004 6:28 pm
Posts: 15
I use that but I receibe 'hibernate_sequence' does not exist, yet I've set as
Code:
   <generator class="sequence">
                <param name="sequence">products_id_seq</param>
        </generator>

Then when I changed both generator class and param name to 'products_id_seq' just to see what happens, it starts working, but when I gets deployed again, obviusly, it says class does not exist.
Am I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 1:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Sounds like some deployment problems to me.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 5:57 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Use this

<id
name="custId"
type="java.lang.Integer"
column="CUST_ID"
>
<generator class="sequence">
<param name="sequence">CUSTOMERS_SQ</param>
</generator>
</id>


But it's seem's to be a deployment problem so when you change an XML mapping file, try to restart your app server after deploy.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 4:16 pm 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
I assume that your are using Postgres. The define a row as ID with SERIAL as type the will create a sequence with "Tablename"_id_seq. That's it.

regards

Olaf


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