-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate can't get the sequence number
PostPosted: Tue Apr 05, 2005 10:01 am 
Newbie

Joined: Tue Apr 05, 2005 9:48 am
Posts: 1
Location: argentina
Hibernate version: 2.1.7C

Mapping documents:

<class name="ReclamoModel"
table="RECLAMOS">

<!-- Common id property. -->
<id name="id"
type="long"
column="ID"
unsaved-value="null">
<generator class="sequence">
<param name="sequence">reclamos_seq</param>
</generator>
</id>

</class>

The error: Relation reclamos_seq does not exist.

Name and version of the database you are using: Postgresql 8.0

The generated SQL (show_sql=true): select nextval('reclamos_seq')

When I save the Entity Bean I get this error, but if I execute the same sql directly into the database, I receive the correct value.


Top
 Profile  
 
 Post subject: Hibernate can't get the sequence number
PostPosted: Tue Oct 23, 2007 6:49 pm 
Regular
Regular

Joined: Fri Feb 09, 2007 3:47 pm
Posts: 56
I'm trying to get a sequence number generated for a column before inserting the values in the table.

I use select nextval('sequence_name') and use this query to read the result into a result set but I get a "relation "sequence_name" does not exist" error.

I'm using postgres 8.1. Any ideas how I can get around this?

Thanks.


Top
 Profile  
 
 Post subject: Hibernate can't get the sequence number
PostPosted: Tue Oct 23, 2007 6:52 pm 
Regular
Regular

Joined: Fri Feb 09, 2007 3:47 pm
Posts: 56
I'm trying to get a sequence number generated for a column before inserting the values in the table.

I use select nextval('sequence_name') and use this query to read the result into a result set but I get a "relation "sequence_name" does not exist" error.

I'm using postgres 8.1. When I create the same the database it works. But not through java/hibernate code.
Any ideas how I can get around this?

Thanks.


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