• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's wrong with my ejb ql?

 
Joe McGuire
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic