-->
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: Runtime Parameter replacement failing
PostPosted: Tue Jan 17, 2006 3:19 pm 
Newbie

Joined: Tue Jan 17, 2006 3:07 pm
Posts: 1
I'm using Hibernate 3 and am having a strange issue with querying one of my persistant objects. The problem is that when I use parameter replacement the query returns no results

"select prod from ProductImpl as prod where prod.myfield=?", productId

If I replace this with the following I get the expected results

"select prod from ProductImpl as prod where prod.myfield='"+productId+"'"

I have other queries using parameter replacement that work fine.

Does anyone have any ideas what would be causing this? The queries are actually performed using the find method in the HibernateTemplate in Spring.

/I


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 4:23 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
may be it is a type issue. Please post the complete query and the mapping.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.