// import features
List exportedFeatures = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoFeatures", null);
Iterator iterFeatures = exportedFeatures.iterator();
while (iterFeatures.hasNext()) {
SbiGeoFeatures expFeature = (SbiGeoFeatures) iterFeatures.next();
String name = expFeature.getName();
Object existObj = importer.checkExistence(name, sessionCurrDB, new SbiGeoFeatures());
SbiGeoFeatures newFeature = null;
if (existObj != null) {
if (!overwrite) {
metaLog.log("Found an existing feature '" + name + "' with "
+ "the same name of the exported feature. It will be not overwritten.");
continue;
} else {
metaLog.log("Found an existing feature '" + name + "' with "
+ "the same name of the exported feature. It will be overwritten.");
newFeature = (SbiGeoFeatures) existObj;
}
} else {
newFeature = new SbiGeoFeatures();
}
newFeature.setName(expFeature.getName());
newFeature.setDescr(expFeature.getDescr());
newFeature.setType(expFeature.getType());
sessionCurrDB.save(newFeature);
metaAss.insertCoupleFeatures(new Integer(expFeature.getFeatureId()), new Integer(newFeature.getFeatureId()));
}
// import association between maps and features
List exportedMapFeatures = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoMapFeatures", null);
Iterator iterMapFeatures = exportedMapFeatures.iterator();