List exportedUdpValue = (List<SbiUdpValue>) hibQuery.list();
Iterator iterSbiUdpValue = exportedUdpValue.iterator();
while (iterSbiUdpValue.hasNext()) {
SbiUdpValue udpvalue = (SbiUdpValue) iterSbiUdpValue.next();
Integer oldId = udpvalue.getUdpValueId();
//import udp first
importUdp(udpvalue.getSbiUdp().getUdpId(), overwrite);
//then udp values
Map assUdpValue = metaAss.getUdpValueAssociation();
Integer existingUdpValueId = null;
Set assUdpValueSet = assUdpValue.keySet();
if (assUdpValueSet.contains(oldId) && !overwrite) {
metaLog.log("Exported association udp value with udp with label " + udpvalue.getSbiUdp().getLabel() + " "
+ " and family " + udpvalue.getFamily() + " with reference id "
+ udpvalue.getReferenceId() + " not inserted"
+ " because already existing into the current database");
continue;
} else {
existingUdpValueId = (Integer) assUdpValue.get(oldId);
}
if (existingUdpValueId != null) {
metaLog.log("The udp value with udp with label " + udpvalue.getSbiUdp().getLabel() + " "
+ " and family " + udpvalue.getFamily() + " with reference id "
+ udpvalue.getReferenceId()+ "] will be updated.");
SbiUdpValue existingUdpValue = ImportUtilities.modifyExistingSbiUdpValue(udpvalue, sessionCurrDB, existingUdpValueId);
ImportUtilities.entitiesAssociationsSbiUdpValue(udpvalue, existingUdpValue, sessionCurrDB, metaAss, importer);
sessionCurrDB.update(existingUdpValue);
} else {
SbiUdpValue newUdpValue = ImportUtilities.makeNewSbiUdpValue(udpvalue, sessionCurrDB, metaAss, importer);
sessionCurrDB.save(newUdpValue);
metaLog.log("The udp value with udp with label " + udpvalue.getSbiUdp().getLabel() + " "
+ " and family " + udpvalue.getFamily() + " with reference id "
+ udpvalue.getReferenceId()+" is inserted");
Integer newId = newUdpValue.getUdpValueId();
sessionExpDB.evict(udpvalue);
metaAss.insertCoupleUdpValueAssociation(udpvalue.getUdpValueId(), newId);
}
}