Query hibQuery = session.createQuery(" from SbiEngines where engineId = " + engine.getId());
List hibList = hibQuery.list();
if(!hibList.isEmpty()) {
return;
}
SbiEngines hibEngine = new SbiEngines(engine.getId());
hibEngine.setName(engine.getName());
hibEngine.setLabel(engine.getLabel());
hibEngine.setDescr(engine.getDescription());
hibEngine.setDriverNm(engine.getDriverName());
hibEngine.setEncrypt(new Short((short)engine.getCriptable().intValue()));
hibEngine.setMainUrl(engine.getUrl());
hibEngine.setObjUplDir(engine.getDirUpload());
hibEngine.setObjUseDir(engine.getDirUsable());
hibEngine.setSecnUrl(engine.getSecondaryUrl());
SbiDomains objTypeDom = (SbiDomains)session.load(SbiDomains.class, engine.getBiobjTypeId());
hibEngine.setBiobjType(objTypeDom);
hibEngine.setClassNm(engine.getClassName());
SbiDomains engineTypeDom = (SbiDomains)session.load(SbiDomains.class, engine.getEngineTypeId());
hibEngine.setEngineType(engineTypeDom);
hibEngine.setUseDataSource(new Boolean(engine.getUseDataSource()));
if (engine.getUseDataSource() && engine.getDataSourceId() != null) {
SbiDataSource ds = (SbiDataSource) session.load(SbiDataSource.class, engine.getDataSourceId());
hibEngine.setDataSource(ds);
}
hibEngine.setUseDataSet(new Boolean(engine.getUseDataSet()));
session.save(hibEngine);
tx.commit();
} catch (Exception e) {
logger.error("Error while inserting engine into export database " ,e);
throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");