Session s=sessionFactory.getCurrentSession();
s.beginTransaction();
String hql="from TempPhotoEdit tempPhotoEdit left join fetch tempPhotoEdit.tempPlan left join fetch tempPhotoEdit.systemFodder where IB_ID=?";
List<TempPhotoEdit> l=s.createQuery(hql).setParameter(0,"25").list();
System.out.println(l);
s.getTransaction().commit();?

本文介绍了一个使用Hibernate框架进行数据库查询的具体示例。通过一条Hibernate查询语言(HQL)实现了从数据库中获取特定ID的记录,并展示了如何设置参数及执行查询。
4万+

被折叠的 条评论
为什么被折叠?



