-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with sequence generator.
PostPosted: Fri Nov 18, 2011 7:49 am 
Newbie

Joined: Fri Nov 18, 2011 7:35 am
Posts: 2
Hi,

One of the database(Postgres DB) columns has been modified as

ALTER TABLE mobile_send ALTER COLUMN column1 SET DEFAULT nextval('mysequence_seq'::text);

In this table along with this i've 5 more columns.

Now when I'm inserting a row into this table except the column 1 then the sequence is automatically generated for column 1.

Ex : insert into table (col2,col3,col4,col5,col6) values ('a','b','c','d','e') (Value for col 1 will be generated.)

Now if the same thing I try doing with hibernate not using generator for col 1 in hbm mapping file its not generating the sequence automatically.

When hibernate is converted into sql ultimately it turns out to be insert Query just like the one I've shown above in the example.

Also, as the sequence is called at the Database level it should actually create the sequence which is not happening !!!

Can anybody tell me what the problem is ??

Thanks in advance.


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

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.