----------------------------------------------------------
In the Entity class
Public Categorybeanpojo (Integer ID, String type, Boolean hot, string login,
String name, String pass, Integer aid) {
Super ();
This.id = ID;
This.type = type;
This.hot = hot;
This.login = login;
THIS.name = name;
This.pass = pass;
This.aid = aid;
}
--------------------------------------------------------------------------
In DAO
Public list<categorybeanpojo> Queryjoinaccount (Categorybeanpojo category,
Pagebean Pagebean) throws exception{
TODO auto-generated Method Stub
StringBuffer sub=new StringBuffer ();
Sub.append ("select");
Sub.append ("Select New Cn.it.shop.pojo.CategoryBeanPojo (c.id as ID,");
Sub.append ("C.type as Type,");
Sub.append ("C.hot as Hot,");
Sub.append ("(select A.login from account as a where a.id=c.aid) as login,");
Sub.append ("(select A.name from account as a where c.aid=a.id) as name,");
Sub.append ("(select A.pass from account as a where c.aid=a.id) as pass,");
Sub.append ("C.aid");
Sub.append (") from Category as C where 1=1");
Sub.append ("and c.type like '%");
if (Category.gettype ()!=null) {
Sub.append (Category.gettype ());
}
Sub.append ("% '");
System.out.println (Sub.tostring ());
Return Pagequery (Sub.tostring (), Pagebean);
}
With regard to the DataGrid query, encapsulates the Pojo object, which must have a constructor with parameters, otherwise it will error unable to locate appropriate constructor on class