文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Hibernate HQL基础 HQL中的连接 左..

Hibernate HQL基础 HQL中的连接 左..

时间:2010-10-10  来源:juxiangwu

使用left outer join子句可以实现左外连接,使用左外连接可以返回对应内连接的所有对象及left outer join子句左边持久化类的未关联对象。如:

 public void testUseLeftOuterJoin(){
         Session session = null;
          session = HibernateUtils.getCurrentSession();
          String hql = "select c from Category c left outer join c.products order by c.id";
          Query query = session.createQuery(hql);
          List<Category> list = query.list();
          HibernateUtils.closeSession(session);
         for(Category obj : list){
             System.out.println(obj.getAllInfo());
         }
    }

相关阅读 更多 +
排行榜 更多 +
无限Fps

无限Fps

飞行射击 下载
幸存者时间僵尸

幸存者时间僵尸

飞行射击 下载
金属兄弟Metal Brother

金属兄弟Metal Brother

冒险解谜 下载