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());
}
}
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());
}
}