-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to disable query parameters binding?
PostPosted: Thu Mar 09, 2006 7:26 pm 
Newbie

Joined: Thu Sep 23, 2004 2:35 pm
Posts: 5
Hibernate version:3.1
Postgres 8.1 (Linux)

Does anybody know how to disable query parameter binding?

WE are trying to tune the perfomance of out application and found that if we run the query with parameters to the query passed as in-line it runs a lot faster.

I can't find a parameter that I can pass to hibernate that would make it NOT use bind parameters.. I want to use in-line parameters to my query..

Is there programatic or configuration way to achive that?

I'm using a Criteria API ..

Regards,

Dmitry.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 8:13 pm 
Expert
Expert

Joined: Mon Jan 09, 2006 5:01 pm
Posts: 311
Location: Sacramento, CA
how about something like:

Query("from Entity where attr=" + value);
and then don't do any parameter binding...

_________________
-JT

If you find my replies helpful, please rate by clicking 'Y' on them. I appreciate it.


Top
 Profile  
 
 Post subject: How to disable query parameters binding?
PostPosted: Thu Mar 09, 2006 9:03 pm 
Newbie

Joined: Thu Sep 23, 2004 2:35 pm
Posts: 5
Thank you for your reply..

that may work, but this is not Criteria API..

I use Criteria objects to build up queries.. I don't bind any parameters as I do that. But hibernate does it automatically by default.. I'm looking for a way to disable that..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 9:41 pm 
Newbie

Joined: Wed Mar 01, 2006 3:45 pm
Posts: 9
the whole point of using Criteria is to make the query use bind variables... so I guess you cannot disable the bind variable with Criteria.

You can use "Query" object with which you can go with or without bind variable either way.


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