This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Question about ejbFind
Null Pointer exception thrown while deploying the cmp bean
EJB PK class
Accessing local entity bean using Session bean
Problem While Deploying Entity Bean