当先锋百科网

首页 1 2 3 4 5 6 7

相关的语句有

 

  String sql="select t_personalbaseinfoentity.realName," +
      "t_personalbaseinfoentity.mobilePhone," +
      "t_personalbaseinfoentity.phone," +
      "t_personalbaseinfoentity.mail," +
      "t_personalbaseinfoentity.qq "+
      "from t_personalbaseinfoentity";

  getSession().createSQLQuery(sql).setResultTransformer(Transformers.aliasToBean(AddressBookInfo.class)).list();

其中AddressBookInfo这个bean中必须要有与查询出来的字段名相同的属性,即这里的bean里需要realName,mobilePhone,phone,mail,qq几个属性以及它们的设置器,即setter,查询结果即可返回List<AddressBookInfo>