首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

基于POJO种构造方法的hql查询

2013-03-04 
基于POJO类构造方法的hql查询hql的查询方法有很多种,昨天接触到了一种基于pojo类的查询方法总结于此:平时

基于POJO类构造方法的hql查询

hql的查询方法有很多种,昨天接触到了一种基于pojo类的查询方法总结于此:

平时我们可以用简单的"FROM [POJO OBJ]"语法来拼装简单的hql查询。如果我们要指定字段的话可以用new一个pojo对象的语法,如下所示:


以下文章用WeiboAccountBean来代指POJO对象:

    public    WeiboAccountBean(Integer   accountid,String   expire,String  token,Integer  companyid,String   userid,String  accountemail,String  accountname,String  accountpassword,Integer   status,String openUrl,String isenable,String source){      this.accountid=accountid;      this.expire=expire;      this.token=token;      this.companyid=companyid;      this.userid=userid;      this.accountemail=accountemail;      this.accountname=accountname;      this.accountpassword=accountpassword;      this.status=status;      this.openUrl = openUrl;      this.isenable = isenable;      this.source = source;      }


热点排行