The pureQuery nested beans example interface

The interface contains the SQL query with a join predicate.
The interface specifies that a list of Dept1 beans contains the information returned from the query.
package mytest;

import java.util.List;
import com.ibm.pdq.annotation.Select;

public interface SimpleQueryInterface
{
    @Select(sql = 
        "SELECT E.EMPLOYEE_CODE, E.FIRST_NAME, E.LAST_NAME, E.DATE_HIRED, "
        + "  ORG.ORGANIZATION_CODE, ORG.ORGANIZATION_NAME_EN"
        + " FROM EMPLOYEE AS E, EMPLOYEE_HISTORY AS EH, ORGANIZATION AS ORG"
        + " WHERE EH.EMPLOYEE_CODE = E.EMPLOYEE_CODE " 
        + "   AND EH.ORGANIZATION_CODE = ORG.ORGANIZATION_CODE"
        + " ORDER BY EH.ORGANIZATION_CODE, E.LAST_NAME ")
    public List<Dept1> joinTest();
}

In a Java project enabled with pureQuery support, Data Studio runs the pureQuery Generator utility to create an implementation class for the interface. You can also generate the implementation class with the pureQuery Generator utility from the command line.

For the example, the implementation class name is SimpleQueryInterfaceImpl. Comments in the implementation class contains information about the relationship between the result set and the pureQuery nested beans.


Feedback