The extending interface can also declare annotated methods. When you then run the pureQuery StaticBinder on the extending interface, you create and bind a DB2® package that contains the SQL statements from the extended interfaces and, if it declares annotated methods, the extending interface.
By following this procedure, you reduce the number of DB2 packages that you need to manage.
public interface SalesTeam {
@Select(sql="SELECT * FROM SALES")
List<SalesBean> getSalesEmployees();
}
public interface MarketingTeam {
@Select(sql="SELECT * FROM MARKETING")
List<MktBean> getMarketingEmployees();
}
You want to bind the SQL statements in these interfaces
into a single DB2 package. You
can do so by following these steps:public interface CombinedTeam extends SalesTeam, MarketingTeam {
@Select("select sales/expense from dept where dept_id=?")
public double getROIforDept(int dept_id);
}