tag:blogger.com,1999:blog-2279343396683500031.post2673531726142931615..comments2023-10-01T16:05:01.765+03:00Comments on caught Somewhere In Time = true;: queryparameterexception: could not locate named parameterSezin Karlihttp://www.blogger.com/profile/00966894788472661642noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2279343396683500031.post-54633589259562117732013-11-01T16:03:49.314+02:002013-11-01T16:03:49.314+02:00Query q1=ses.createQuery("select st from Stud...Query q1=ses.createQuery("select st from StudentDemo as st where st.smail like ? and st.sname in(:p2,:p3) order by st.sid desc");<br /> // set parameter<br /> q1.setInteger("@gmail.com", 0);<br /> q1.setString("p2", "subbu");<br /> q1.setString("p3", "raju");<br /> //execute hql query<br /> List l=q1.list();<br /><br />this Anonymoushttps://www.blogger.com/profile/03684935108849603120noreply@blogger.comtag:blogger.com,1999:blog-2279343396683500031.post-2748918812040041302012-03-09T13:51:20.807+02:002012-03-09T13:51:20.807+02:00Hi Kalpana,
I can't exactly pinpoint your pro...Hi Kalpana,<br /><br />I can't exactly pinpoint your problem.<br />I would check if there's a problem related to table names, column names etc, if the model mappings are right. For instance if you're trying to query terminalid but you dont have it in your model it would generate an exception. Another case is the case where your terminalid is long or integer but youre trying to set Sezin Karlihttps://www.blogger.com/profile/00966894788472661642noreply@blogger.comtag:blogger.com,1999:blog-2279343396683500031.post-12139109115811580582012-03-09T13:33:09.793+02:002012-03-09T13:33:09.793+02:00Hi Sezin,
Thanks for your response.
that is also...Hi Sezin,<br /><br />Thanks for your response.<br /><br />that is also throwing exception.<br /><br />java.lang.IllegalArgumentException: Parameter terminalid does not exist as a named parameter in [select m.id.machineid from hibernate.ORMObjects.TerminalMachineMapping m where m.id.terminalid = :terminalid]Kalpanahttps://www.blogger.com/profile/15783936404026958717noreply@blogger.comtag:blogger.com,1999:blog-2279343396683500031.post-42031919284896078062012-03-09T09:02:49.115+02:002012-03-09T09:02:49.115+02:00Hi Kalpana,
why you don't use query.setString...Hi Kalpana,<br /><br />why you don't use query.setString("terminalid", "EJD001");<br />This is probably due to this.Sezin Karlihttps://www.blogger.com/profile/00966894788472661642noreply@blogger.comtag:blogger.com,1999:blog-2279343396683500031.post-57253451437005379412012-03-09T07:08:57.180+02:002012-03-09T07:08:57.180+02:00Hi
I am using the below query in the same format a...Hi<br />I am using the below query in the same format as said by you.<br />Query query = session.createQuery("select id.machineid from hibernate.ORMObjects.TerminalMachineMapping m where m.id.terminalid = :terminalid");<br />query.setParameter("terminalid", "EJD001");<br /> <br />Iterator ite = query.list().iterator();<br /><br />but getting the below exception<brKalpanahttps://www.blogger.com/profile/15783936404026958717noreply@blogger.com