4 Replies Latest reply on Feb 4, 2002 8:39 PM by nick

    CMP EJB QL returns no results

    tabuchan

      Hi,

      I am trying to query a database using a custom EJB QL finder method. There are no compilation or deployment errors with this method, but it returns no records. I know for certain that there are records in the table that should match the parameters I am giving the method.

      The ejb-jar.xml is:
      <abstract-schema-name>EmployeeMySQL</abstract-schema-name>

      ......


      <query-method>
      <method-name>findByDepartmentAndTitle</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>

      <ejb-ql>SELECT OBJECT(e) FROM EmployeeMySQL AS e WHERE e.Department = ?1 AND e.Title = ?2</ejb-ql>



      I have this method returning a Collection in my home interface.

      Collection collection = home.findByDepartmentAndTitle("Finance","Mr");

      Can anyone please tell me where I am going wrong? I just don't understand why I am getting an empty Collection instance once this method has been called.

      TABuchan