(1) For future reference when I ask for a stack trace, I mean the WHOLE stack trace! ie. including the stack trace from inside Hibernate. If you swallow the stack trace in your application, it looks to me like the exception occurs in *your* code.
(2) You are not telling me the whole truth! This code:
session.find(hQuery);
ie. A query with no parameters NEVER results in a call to nullSafeSet(), unless there is some association or *something* that is being loaded recursively. However, your mapping document does not show any association. Perhaps you are implementing Lifecycle or something.
Quote:
why is Hibernate trying to cast the first column value in the resultset (which is has retrieved successfully) to an int when it is actually a String (varchar)
Hibernate is doing
nothing of the sort! The call to set() is passed a PreparedStatement, not a ResultSet. This is all occurring in prepareQueryStatement, BEFORE a query is executed, and BEFORE there is any result set.
now look at this:
Code:
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42)
ie. we are inside a *load()*, not a query!. What looks to be happening is that there is some association or something that you havn't told me about. So the first query has successfully executed and now something sparks a second query.
Now, what I need is
the whole Hibernate stack trace. Where is the rest of the stack trace, ie. before EntityLoader.load?