File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes What's wrong with my ejb ql? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "What Watch "What New topic
Author

What's wrong with my ejb ql?

Joe McGuire
Ranch Hand

Joined: Mar 19, 2001
Posts: 293
I am using ejb query language set in the ejb-jar.xml file. The searches work fine when using 1 parameter, but if I use an "AND" statement for 2 parameters, the search returns nothing, although the data is in the database that should return a record. Can anyone see why this is not working?
The findByID(String id) and findByTsDate(String tsDate) methods work, but the findByIdAndTsDate(String id, String tsDate) does not.
From the home interface:

From the ejb-jar.xml:
Joe McGuire
Ranch Hand

Joined: Mar 19, 2001
Posts: 293
Solution found.
I changed all the date fields from type String to type java.sql.Date like they logically should be, and fixed whatever was the problem with my findByIdAndTsDate method. I also changed the hours field to type float. EJB queries work great now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's wrong with my ejb ql?
 
Similar Threads
Accessing local entity bean using Session bean
Question about ejbFind
EJB PK class
Problem While Deploying Entity Bean
Null Pointer exception thrown while deploying the cmp bean