GeeCON Prague 2014*
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


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.
 
GeeCON Prague 2014
 
subject: What's wrong with my ejb ql?