FETCH查询

@Test
 public void getNow() {
  Mod mod = (Mod) session.createQuery("from Mod mod left join fetch mod.style where mod.id = 95").uniqueResult();
  for (Style style : mod.getStyle()) {
   System.out.println(style.getName());
  }
 }

你可能感兴趣的:(java)