Ok, here's some more details. Any hints would be much appreciated.
The complete stack trace is at the bottom.
here's the HQL:
select myresult from Result myresult where (myresult.user.age >= (:minage) and myresult.user.age <= (:maxage)) and myresult.team.id in (:teamids) order by myresult.race.event.eventdate desc
and here's the SQL:
Hibernate: select result0_.resultid as resultid, result0_.place as place, result0_.time as time, result0_.categoryid as categoryid, result0_.raceid as raceid, result0_.teamid as teamid, result0_.userid as userid from result result0_, users user1_, race race2_, event event3_ where result0_.raceid=race2_.raceid and race2_.eventid=event3_.eventid and (((user1_.age>=(?) and result0_.userid=user1_.userid)and(user1_.age<=(?) and result0_.userid=user1_.userid))and(result0_.teamid in(?))) order by event3_.eventdate desc limit ?, ?
I noticed is that the generated SQL is different if I set the List parameters with setParameterList versus using setProperties(). With setProperties(), the generated SQL for the List parameter when supplying an ArrayList of three integers is:
result0_.teamid in(?)
But when I use setParameterList(), I get:
result0_.teamid in(? , ? , ?)
guessType isn't throwing an exception, so Hibernate must recognize the list of integers, but I only see one (?) in the query string, and when the query executes, I get this:
java.sql.SQLException: ERROR: pg_atoi: error in "\254\355\000\005ur\000\024[Ljava.lang.Integer;\376\227\255\240\001\203\342\033\002\000\000xp\000\000\000\002psr\000\021java.lang.Integer\022\342\240\244\367\201\2078\002\000\001I\000\005valuexr\000\020java.lang.Number\206\254\225\035\013\224\340\213\002\000\000xp\000\000 \300": can't parse "\254\355\000\005ur\000\024[Ljava.lang.Integer;\376\227\255\240\001\203\342\033\002\000\000xp\000\000\000\002psr\000\021java.lang.Integer\022\342\240\244\367\201\2078\002\000\001I\000\005valuexr\000\020java.lang.Number\206\254\225\035\013\224\340\213\002\000\000xp\000\000 \300"
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:153)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:62)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:537)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:140)
at net.sf.hibernate.loader.Loader.find(Loader.java:604)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:912)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1356)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76)
at com.services.ViewResultsService$ViewResults.viewResults(ViewResultsService.java:95)
at com.action.ViewResultsAction.viewresults(ViewResultsAction.java:58)
at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
|