public class ADTO
{
public ADTO(String a,String b){
this.apname=a;
this.apname=b;
}
String prcode;
String apname;
public String getApname()
{
return apname;
}
public void setApname(
String apname)
{
this.apname = apname;
}
public String getPrcode()
{
return prcode;
}
public void setPrcode(
String prcode)
{
this.prcode = prcode;
}
}
public static void main(
String[] args)
throws Exception
{
Session session = SessionManager.getNewSession();
String hql = "select new test.ADTO(a.prcode,b.apname) " +
"from com.life.persistence.policy.group.GpyPlan a,com.life.persistence.policy.group.GpyPoli b where a.policyno=b.id and b.polists='01' and b.id like '998%'";
List list=session.createQuery(hql).list();
System.out.println(list.size());
System.out.println(list.get(0).getClass().getName());
ADTO adto=(ADTO)list.get(0);
}