文章详情

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

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

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

fetch子句可以与左外连接结合使用,称为“迫切左外连接”。如:

public void testForceLeftOuterJoin(){
         Session session = null;
          session = HibernateUtils.getCurrentSession();
          String hql = "select c from Category c left join fetch c.products";
          Query query = session.createQuery(hql);
          List<Category> list = query.list();
          HibernateUtils.closeSession(session);
         for(Category c : list){
            System.out.println(c.toString());
            Set<Product> products = c.getProducts();
            for(Product p :products){
                System.out.println(p.toString());
            }
         }
    }
相关阅读 更多 +
排行榜 更多 +
无限Fps

无限Fps

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

幸存者时间僵尸

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

金属兄弟Metal Brother

冒险解谜 下载