EJB QL NOT RETURNING AN INNER JOIN

Discussions

EJB programming & troubleshooting: EJB QL NOT RETURNING AN INNER JOIN

  1. EJB QL NOT RETURNING AN INNER JOIN (1 messages)

    Hi: I am using weblogic 8.1. I wrote this EJB QL: findProduct com.CategoryLocal SELECT OBJECT(p) FROM Product p, Category c where c = ?1 I have a product table which has a foreign key of "categoryid". I passed it a CategoryLocal object with primary key of 1. I was expecting two records of product to return with categoryId of 1. Instead I receive all the records in the product table as if I am doing a "select * from product". Am I writing the ejb ql incorrectly to get what I want? Any hint would be greatly appreciated!!! Yours, Frustrated.
  2. A normal SQL must be as follows : select * from product p, category c where c=1 and p.categoryid=c.id so, are you missing this p.categoryid=c.id or do you expect ejbql to take care of such join. I have never used ejbql thats y.