-->
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: Problems with Hibernate Discriminators and postgreSQL
PostPosted: Wed Mar 23, 2011 7:55 pm 
Newbie

Joined: Wed Mar 23, 2011 7:48 pm
Posts: 1
Hi,

I have a problem with Hibernate's "single tables" and the last postgres jdbc driver. It seems that now, driver adds a "returning *" when there is an Insert, instead of a returning [identifier] that seems more cleaner and doesn't return all the fields.

Because of the added "returning *", it crashes when there is an Insert in a table with a String type discriminator, returning this :

Caused by: org.postgresql.util.PSQLException: Bad value for type long : NACIONAL
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2796)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2019)
at org.hibernate.id.IdentifierGeneratorHelper.get(IdentifierGeneratorHelper.java:114)
at org.hibernate.id.IdentifierGeneratorHelper.getGeneratedIdentity(IdentifierGeneratorHelper.java:86)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:98)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)

Hibernate (3.5.4) thinks that the identifier column is the discriminator column.

Thanks for any feedback!


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.