-->
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.  [ 3 posts ] 
Author Message
 Post subject: Query like params HQL
PostPosted: Mon Mar 14, 2005 6:27 am 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
Hi can you help me to use HQL with this query:

Query q = new Query("from CModelliVO as ay where ay.de50pf like '%?% ')
q.setString(0,'MARE')

well, i wish to use the % with a params but i don't know how to do.
Can you help me?
If i use a composite String work but with a params ?

with composite String
String s="from CModelliVO as ay where ay.de50pf like '%"+params+"% '"
Query q = new Query(s);


Hibernate version: 3

Bye devis


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 10:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use

Query q = new Query("from CModelliVO as ay where ay.de50pf like '? ')
q.setString(0,'%MARE%')


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 11:02 am 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
Thank's work fine
Devis


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.