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: question about the HQL query
PostPosted: Thu Sep 02, 2004 12:44 am 
Newbie

Joined: Sun Aug 08, 2004 2:38 am
Posts: 9
Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

Debug level Hibernate log excerpt:

Hi,everyone.
I use hibnerate + JBX to write a piece of code to fetch data in database out. And when I use list = session.find("from sometable"); Noting is wrong. But when I want to use list = session.find("from" + " " + str); It is reported that could not excute query. I wonder whether the HQL language can only use just a whole string to query. But when I use this: list = session(new String("from" + " " + str));, the same error occured.

Please help!

Thanks, Have a nice day!

Regards,

Geroge Ren

_________________
THINK!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2004 7:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
use your debugger to see what is exactly stored in your string

note: string concatenation is always a bad thing!

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.