-->
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.  [ 2 posts ] 
Author Message
 Post subject: "Parameter index out of bounds" in update using Di
PostPosted: Sat Mar 04, 2006 1:09 pm 
Newbie

Joined: Tue Jan 17, 2006 5:46 pm
Posts: 7
Hi,

I'm trying to execute a simple update of a subclass entity in a "Table per Class hierarchy" mapping. The SQL Hibernate is creating (and the resulting SQL error) seemed odd enough that it warranted posting.

Here's what Tomcat is telling me:

Hibernate: insert into Content (shortText, title, author_id, approveDate, approver_id, createDate, editDate, contentStatus, longString, type) values (?, ?, ?, ?, ?, ?, ?, ?, ?, 'app')
119750 [http-8080-Processor25] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
119750 [http-8080-Processor25] ERROR org.hibernate.util.JDBCExceptionReporter - Parameter index out of bounds. 10 is not between valid values of 1 and 9
119781 [http-8080-Processor25] ERROR org.hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)

Does anyone know why Hibernate would generate an SQL statement with 9 '?'s and one string literal ('app') in the values field? (Note: the 'app' column is the discriminator column) Also, any clues as to why Hibernate would be getting mixed up and trying param 10 there?

I am using annotations to map this class, with the latest version of Hibernate core. An old post said this was a no-no (you shouldn't use the latest core release w/annotations), but nothing else has blown up and this seems a strange place for it.

Any help would be much appreciated. thnx,
Rogers


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 5:52 pm 
Newbie

Joined: Tue Jan 17, 2006 5:46 pm
Posts: 7
solved. sorry- I had not marked an @Overriden child property as @Transient, which was giving me an extra column in the query.


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