First of all I would be suspicious of this:
Originally posted by sajjad ahmad:
In your query you use
LIKE but the parameter doesn't use the
pattern matching character "%". I suspect that the parameter should be "N%". When you are building the query with the Criteria API you don't use the pattern matching character because you specify it in a different way - however when you are using HQL I believe that you have to specify it. See
14.9. Expressions
Originally posted by sajjad ahmad:
Also please tell me is there any plugin available for jbuilder to write and debug those HQL queries...
Don't know about a plugin, but in the hibernate.cfg.xml you can set
or alternately in the hibernate.properties
to have the generated SQL sent to log4j. Then it�s a matter of configuring the log4.properties to redirect the output to the desired target. Here is the one that comes with the caveatemptor(h3) sample application that redirects everything to the console:
[ April 19, 2006: Message edited by: Peer Reynders ]