* @throws EMFUserError the EMF user error
*/
public static SbiObjects modifyExistingSbiObject(SbiObjects exportedObj, Session sessionCurrDB,
Integer existingId) throws EMFUserError {
logger.debug("IN");
SbiObjects existingObj = null;
try {
// update document
existingObj = (SbiObjects) sessionCurrDB.load(SbiObjects.class, existingId);
existingObj.setName(exportedObj.getName());
existingObj.setDescr(exportedObj.getDescr());
existingObj.setLabel(exportedObj.getLabel());
existingObj.setExecModeCode(exportedObj.getExecModeCode());
existingObj.setObjectTypeCode(exportedObj.getObjectTypeCode());
existingObj.setPath(exportedObj.getPath());
existingObj.setRelName(exportedObj.getRelName());
existingObj.setStateConsiderationCode(exportedObj.getStateConsiderationCode());
existingObj.setUuid(exportedObj.getUuid());
existingObj.setEncrypt(exportedObj.getEncrypt());
existingObj.setSbiEngines(exportedObj.getSbiEngines());
existingObj.setSchedFl(exportedObj.getSchedFl());
existingObj.setSbiObjStates(new HashSet());
existingObj.setVisible(exportedObj.getVisible());
existingObj.setProfiledVisibility(exportedObj.getProfiledVisibility());
existingObj.setRefreshSeconds(exportedObj.getRefreshSeconds());
// deletes existing associations between object and parameters
Set objPars = existingObj.getSbiObjPars();
Iterator objParsIt = objPars.iterator();
while (objParsIt.hasNext()) {
SbiObjPar objPar = (SbiObjPar) objParsIt.next();
// for each biobjectparameter deletes all its dependencies, if any
Query query = sessionCurrDB.createQuery(" from SbiObjParuse where id.sbiObjPar.objParId = " + objPar.getObjParId());