logger.debug("IN");
try {
List exportedParDepends = importer.getFilteredExportedSbiObjects(sessionExpDB, "SbiObjParuse", "id.sbiObjPar.sbiObject.biobjId", exportedBIObjectId);
Iterator iterParDep = exportedParDepends.iterator();
while (iterParDep.hasNext()) {
SbiObjParuse pardep = (SbiObjParuse) iterParDep.next();
// get ids of objpar and paruse associated
Integer objparId = pardep.getId().getSbiObjPar().getObjParId();
Integer paruseId = pardep.getId().getSbiParuse().getUseId();
Integer objparfathId = pardep.getId().getSbiObjParFather().getObjParId();
String filterOp = pardep.getId().getFilterOperation();
// get association of objpar and paruses
Map objparIdAss = metaAss.getObjparIDAssociation();
Map paruseIdAss = metaAss.getParuseIDAssociation();
// try to get from association the id associate to the exported
// metadata
Integer newObjparId = (Integer) objparIdAss.get(objparId);
Integer newParuseId = (Integer) paruseIdAss.get(paruseId);
Integer newObjParFathId = (Integer) objparIdAss.get(objparfathId);
// build a new id for the SbiObjParuse
SbiObjParuseId objparuseid = pardep.getId();
objparuseid.setFilterOperation(filterOp);
if (newParuseId != null) {
SbiParuse sbiparuse = objparuseid.getSbiParuse();
SbiParuse newParuse = ImportUtilities.makeNewSbiParuse(sbiparuse, newParuseId);
objparuseid.setSbiParuse(newParuse);
paruseId = newParuseId;
}
if (newObjparId != null) {
SbiObjPar sbiobjpar = objparuseid.getSbiObjPar();
SbiObjPar newObjPar = ImportUtilities.makeNewSbiObjpar(sbiobjpar, newObjparId);
objparuseid.setSbiObjPar(newObjPar);
objparId = newObjparId;
}
if (newObjParFathId != null) {
SbiObjPar sbiobjparfath = objparuseid.getSbiObjParFather();
SbiObjPar newObjParFath = ImportUtilities.makeNewSbiObjpar(sbiobjparfath, newObjParFathId);
objparuseid.setSbiObjParFather(newObjParFath);
objparfathId = newObjParFathId;
}
pardep.setId(objparuseid);
Map unique = new HashMap();
unique.put("objparid", objparId);
unique.put("paruseid", paruseId);
unique.put("objparfathid", objparfathId);
unique.put("filterop", filterOp);
Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiObjParuse());
if (existObj == null) {
sessionCurrDB.save(pardep);
metaLog.log("Inserted new dependecies between biparameter "
+ pardep.getId().getSbiObjPar().getLabel() + " of the biobject "
+ pardep.getId().getSbiObjPar().getSbiObject().getLabel() + " and paruse "
+ pardep.getId().getSbiParuse().getLabel());
}
}
} catch (HibernateException he) {
logger.error("Error while inserting object ", he);
throw new EMFUserError(EMFErrorSeverity.ERROR, "8004", "component_impexp_messages");