child.setParent( parent );
session.save( parent );
session.getTransaction().commit();
session.close();
CollectionStatistics stats = sfi().getStatistics().getCollectionStatistics( Parent.class.getName() + ".children" );
long recreateCount = stats.getRecreateCount();
long updateCount = stats.getUpdateCount();
session = openSession();
session.beginTransaction();
parent = ( Parent ) session.get( Parent.class, "p1" );
assertEquals( 1, parent.getChildren().size() );
session.getTransaction().commit();
session.close();
assertEquals( 1, parent.getChildren().size() );
assertEquals( recreateCount, stats.getRecreateCount() );
assertEquals( updateCount, stats.getUpdateCount() );
session = openSession();
session.beginTransaction();
assertEquals( 1, parent.getChildren().size() );
session.delete( parent );