t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
Dimension dim = new Dimension( 3, Integer.MAX_VALUE );
s.save( dim );
list = s.createSQLQuery( "select d_len * d_width as surface, d_len * d_width * 10 as volume from Dimension" ).list();
s.delete( dim );
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
SpaceShip enterprise = new SpaceShip();
enterprise.setModel( "USS" );
enterprise.setName( "Entreprise" );
enterprise.setSpeed( 50d );
Dimension d = new Dimension(45, 10);
enterprise.setDimensions( d );
s.save( enterprise );
Object[] result = (Object[]) s.getNamedQuery( "spaceship" ).uniqueResult();
enterprise = ( SpaceShip ) result[0];
assertTrue(50d == enterprise.getSpeed() );