Hibernate ID method: projection object identifier

id()

Example

Criteria criteria = session.createCriteria(UserForm.class);  //获取Criteria对象
criteria.setProjection(Projections.id());  //设置投影查询列
list = criteria.list();  //获取查询结果集
Iterator it = list.iterator();  //获取查询结果集迭代器
while(it.hasNext()){  //循环遍历查询迭代器
  System.out.println("用户ID:"+it.next());
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>