-->
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: Hibernate3 beta4b + PostgreSQL 8 + quoted table/column name
PostPosted: Sun Feb 27, 2005 11:05 pm 
Newbie

Joined: Sun Feb 27, 2005 10:53 pm
Posts: 3
Location: Hong Kong
I tried the following mapping:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
   <class name="A" table="`A`" lazy="false">
      <id name="Id" column="`id`" type="integer" unsaved-value="0">
         <generator class="identity">
         </generator>
      </id>
      <property name="Column" column="`Column`" type="long" not-null="false"/>
   </class>
</hibernate-mapping>


I quoted all table and column name with (`), when I save an object A, it generate:
Code:
Hibernate: insert into "A" ("Column") values (?)
Hibernate: select currval('"A"_"id"_seq')
09:46:10,421  WARN JDBCExceptionReporter:57 - SQL Error: 0, SQLState: 42602
09:46:10,421 ERROR JDBCExceptionReporter:58 - ERROR: invalid name syntax


I looked at the database, the sequence name is "A_id_seq", so the correct statement should be select currval('"A_id_seq"'). Is it a bug?

Thanks.


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.