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() );
assertTrue( 450d == extractDoubleValue( result[1] ) );
assertTrue( 4500d == extractDoubleValue( result[2] ) );
s.delete( enterprise );
t.commit();
s.close();