logger.debug("IN");
try {
List exportedFunctObjects = importer.getFilteredExportedSbiObjects(sessionExpDB, "SbiObjFunc", "id.sbiObjects.biobjId", exportedBIObjectId);
Iterator iterSbiFunctObjects = exportedFunctObjects.iterator();
while (iterSbiFunctObjects.hasNext()) {
SbiObjFunc objfunct = (SbiObjFunc) iterSbiFunctObjects.next();
// get ids of exported role, function and state associzted
Integer functid = objfunct.getId().getSbiFunctions().getFunctId();
Integer objid = objfunct.getId().getSbiObjects().getBiobjId();
Integer prog = objfunct.getProg();
// get association of roles and paruses
Map functIdAss = metaAss.getFunctIDAssociation();
Map biobjIdAss = metaAss.getBIobjIDAssociation();
// try to get from association the id associate to the exported
// metadata
Integer newFunctid = (Integer) functIdAss.get(functid);
Integer newObjectid = (Integer) biobjIdAss.get(objid);
// build a new id for the SbiObjFunct
SbiObjFuncId objfunctid = objfunct.getId();
if (objfunctid != null) {
SbiFunctions sbifunct = objfunctid.getSbiFunctions();
SbiFunctions newFunct = ImportUtilities.makeNewSbiFunction(sbifunct, newFunctid);
objfunctid.setSbiFunctions(newFunct);
functid = newFunctid;
}
if (newObjectid != null) {
SbiObjects sbiobj = objfunctid.getSbiObjects();
SbiObjects newObj = ImportUtilities.makeNewSbiObject(sbiobj, newObjectid);
objfunctid.setSbiObjects(newObj);
objid = newObjectid;
}
objfunct.setId(objfunctid);
// check if the association between metadata already exist
Map unique = new HashMap();
unique.put("objectid", objid);
unique.put("functionid", functid);
Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiObjFunc());
if (existObj == null) {
sessionCurrDB.save(objfunct);
metaLog.log("Inserted new association between function "
+ objfunct.getId().getSbiFunctions().getName() + " and object "
+ objfunct.getId().getSbiObjects().getName());
}
}
} catch (HibernateException he) {
logger.error("Error while inserting object ", he);
throw new EMFUserError(EMFErrorSeverity.ERROR, "8004", "component_impexp_messages");