if ( polar ) {
PolarCloud polarCloud = new PolarCloud();
polarCloud.setLength( length );
for ( String description : producedSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
polarCloud.getProducedSnowFlakes().add( sf );
}
for ( String description : backupSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
polarCloud.getBackupSnowFlakes().add( sf );
}
cloud = polarCloud;
}
else {
AnnotatedCloud annotatedCloud = new AnnotatedCloud();
annotatedCloud.setLength( length );
for ( String description : producedSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
annotatedCloud.getProducedSnowFlakes().add( sf );
}
for ( String description : backupSnowflakes ) {
SnowFlake sf = new SnowFlake();
sf.setDescription( description );
session.save( sf );
annotatedCloud.getBackupSnowFlakes().add( sf );
}
cloud = annotatedCloud;
}