This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes needs help for EJBQL  query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "needs help for EJBQL  query" Watch "needs help for EJBQL  query" New topic

needs help for EJBQL query

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
hi everybody
I am using following EJBQL query in my app deployed succesfully on jBoss 4.0.4
But I am not getting anything from the querry the size of result is always 0 I mean the querry retuns no elements from the DB but there are rows satisfying the query.
method signature:> public java.util.Collection findByName(String name)throws FinderException, RemoteException


Also is there any tool that can show what class and/or querry the container has generated for our CMP-EJB and EJBQL.


SCJP 1.4
Debu Panda
Ranch Hand

Joined: Jan 21, 2007
Posts: 100
I'm not a JBoss expert. But you can use P6SPY to see what SQL was executed by a CMP engine.

If I remember correctly EJBQL does not allow %with a parameter

Can you try changing: LIKE '%?1%'

To LIKE '?1'

Pass the parameter that has % as follows:


Author: EJB 3 In Action (
Debu Panda
Ranch Hand

Joined: Jan 21, 2007
Posts: 100
another way to get it around by using

like CONCAT('%',CONCAT(?1,'%'))
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Yes, I think it was the same for JDBC.

[My Blog]
All roads lead to JavaRanch
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: needs help for EJBQL query
It's not a secret anymore!