*
* @throws EMFUserError
*/
private void importChecks() throws EMFUserError {
logger.debug("IN");
SbiChecks check = null;
try {
List exportedChecks = importer.getAllExportedSbiObjects(sessionExpDB, "SbiChecks", null);
Iterator iterSbiChecks = exportedChecks.iterator();
while (iterSbiChecks.hasNext()) {
check = (SbiChecks) iterSbiChecks.next();
Integer oldId = check.getCheckId();
Map checkIdAss = metaAss.getCheckIDAssociation();
Set checkIdAssSet = checkIdAss.keySet();
if (checkIdAssSet.contains(oldId)) {
metaLog.log("Exported check " + check.getName() + " not inserted"
+ " because it has the same label of an existing check");
continue;
}
SbiChecks newck = ImportUtilities.makeNewSbiCheck(check);
String valueCd = check.getValueTypeCd();
Map unique = new HashMap();
unique.put("valuecd", valueCd);
unique.put("domaincd", "CHECK");
SbiDomains existDom = (SbiDomains) importer.checkExistence(unique, sessionCurrDB, new SbiDomains());
if (existDom != null) {
newck.setCheckType(existDom);
newck.setValueTypeCd(existDom.getValueCd());
}
sessionCurrDB.save(newck);
metaLog.log("Inserted new check " + newck.getName());
Integer newId = newck.getCheckId();
metaAss.insertCoupleCheck(oldId, newId);
}
} catch (Exception e) {
if (check != null) {
logger.error("Error while importing exported check with label [" + check.getLabel() + "].", e);