public Cloud createAndSave() {
Session session = sessions.openSession();
Transaction transaction = session.beginTransaction();
Cloud cloud = new Cloud();
cloud.setLength( length );
for ( String description : producedSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
cloud.getProducedSnowFlakes().add( sf );
}
for ( String description : backupSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
cloud.getBackupSnowFlakes().add( sf );
}
session.persist( cloud );
transaction.commit();