address.setStreet( "somewhere over the rainbow" );
address.setCity( "lawerence, kansas" );
address.setPostalCode( "toto");
customer.setAddress( address );
customer.setFamily( new HashSet() );
Person son = ProxyHelper.newPersonProxy();
son.setName( "son" );
customer.getFamily().add( son );
Person wife = ProxyHelper.newPersonProxy();
wife.setName( "wife" );
customer.getFamily().add( wife );
session.save( customer );
session.getTransaction().commit();
session.close();
assertNotNull( "company id not assigned", company.getId() );
assertNotNull( "customer id not assigned", customer.getId() );
assertNotNull( "address id not assigned", address.getId() );
assertNotNull( "son:Person id not assigned", son.getId() );
assertNotNull( "wife:Person id not assigned", wife.getId() );
// Test loading these dyna-proxies, along with flush processing
session = openSession();
session.beginTransaction();
customer = ( Customer ) session.load( Customer.class, customer.getId() );