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 EJB QL Problems 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 "EJB QL Problems" Watch "EJB QL Problems" New topic
Author

EJB QL Problems

Jayesh Netravali
Greenhorn

Joined: May 07, 2003
Posts: 12
Hi,
I have a simple table named PRODUCT consisting of two columns PRODUCTID and PRODUCTNAME. I have written a CMP entity bean and have deployed it on Weblogic 7. I have one finder method findByName which takes the Product Name returns a Collection. Through my client when I call the finder method it does not return any records.

The query under my EJB QL is
SELECT OBJECT(o) FROM Product AS o where o.productName = ?1

where Product is the name of the Abstract schema and is same as that of the table.

I modified the query to
SELECT OBJECT(o) FROM Product AS o where o.productName like ?1
and
SELECT OBJECT(o) FROM Product AS o where o.productName <> ?1

but still I am not getting any records.

I am able to insert records in the DB by calling the create() method on the home interface. But when I call findByPrimaryKey() method and pass the Product Id which exists in the table it gives me a SQLException saying No Data Found.

Are the queries executed by the container logged somewhere and can I see which query it is executing.

My database is MS Access.

Thanks in advance.
Jayesh.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB QL Problems