怎样用hibernate读取一条记录的部分字段? 如题,现在需要取出一条记录的部分字段。因为有一个字段不需要用到,并且那个字段的数据量很大(相当于论坛显示贴子列表时不需要读取贴子内容一样)请问该怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String hql="select t.字段1,t.字段2... from Tab t";查询返回时个数组,楼主再去读取吧 SELECT columnname from tablename这样不就可以了么 如果你还想返回的是对像而不是LIST<Object[]>可以使用selec new TProduct(productid, productname) from TProduct注意TProduct类中要有相应的构造方法public TProduct(String productid, String productname) { this.productid = productid; this.productname = productname;} 数据库问题 请教一个基本的SSH的问题 mysql 数据库迁移 spring3.0.3 +activemq5.4.2怎么整合啊?请教大虾们 关于JBoss EJB3集群配置问题 一个servlet可以用什么办法知道这个服务器上配置了多少servlet?(送分) 请问<ul></ul>这对标签是什么功能啊? 我提出的这个问题至今无人能解答 看来高手也不多嘛 Jquery Aja后台获取的值如何传给前台 桌面文件怎么拖到虚拟机 有关安全级别 java 选择性的 遍历 map 方法
查询返回时个数组,楼主再去读取吧
这样不就可以了么
selec new TProduct(productid, productname) from TProduct
注意TProduct类中要有相应的构造方法
public TProduct(String productid, String productname) {
this.productid = productid;
this.productname = productname;
}