This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have following EJB QL: SELECT OBJECT(p) FROM Product p WHERE p.homeCategory = ?1
which for some weird reason is returning only the first record in the table Product. In the table product there is a foreign key called categoryId that points to the primary key of the field CategoryId of the table Category. There is three records in the table Product that contains a foregn key of CategoryId=1, THEREFORE THE ABOVE SQL should return three records from the Product table but the result only returns the first record of the Product table no matter what the value is for the first record of the CategoryId field for the Product Table.
Here is the client jsp code that calls the ejb: package com;
Here is the weblogic-cmp-rdbms.xml: <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'> <weblogic-rdbms-jar>
</weblogic-enterprise-bean> <!-- Map the ejbbook user to the Employees role --> <security-role-assignment> <role-name>Employees</role-name> <principal-name>ejbbook</principal-name> </security-role-assignment>
I passed a categoryId of 1 for the above EJB-QL but for some reason, it only returns the first record of the Product Table. It doesn't seem to matter what the value of the CategoryId. That seems strange. Is my EJB/QL correct?