1 | public void testNestedCollectionFetch() {↵ | | 1 | private void cleanup() {↵
|
2 | Session s = openSession();↵ | | 2 | Session s = openSession();↵
|
3 | Transaction t = s.beginTransaction();↵ | | 3 | Transaction txn = s.beginTransaction();↵
|
4 | ↵ | | 4 | ↵
|
5 | s.createQuery("from Animal a left join fetch a.offspring o left join fetch o.offspring where a.mother.id = 1 order by a.description").list();↵ | | 5 | s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate();↵
|
6 | s.createQuery("from Zoo z left join fetch z.animals a left join fetch a.offspring where z.name ='MZ' order by a.description").list();↵ | | 6 | s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();↵
|
7 | s.createQuery("from Human h left join fetch h.pets a left join fetch a.offspring where h.name.first ='Gavin' order by a.description").list();↵ | | 7 | s.createQuery( "delete Animal" ).executeUpdate();↵
|
|
8 | t.commit();↵ | | 8 | txn.commit();↵
|
9 | s.close();↵ | | 9 | s.close();↵
|
10 | | | 10 |
|