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
|