String familyKey = ami.generateRepoMetaKey(stackName, stackVersion, family,
stackRepoId, AmbariMetaInfo.REPOSITORY_XML_PROPERTY_BASEURL);
// need to use (for example) redhat6 if the os is centos6
MetainfoEntity entity = metaDao.findByKey(key);
if (null == entity) {
entity = new MetainfoEntity();
entity.setMetainfoName(key);
entity.setMetainfoValue(repoUrl);
metaDao.merge(entity);
} else {
entity.setMetainfoValue(repoUrl);
metaDao.merge(entity);
}
entity = metaDao.findByKey(familyKey);
if (null == entity) {
entity = new MetainfoEntity();
entity.setMetainfoName(familyKey);
entity.setMetainfoValue(repoUrl);
metaDao.merge(entity);
} else {
entity.setMetainfoValue(repoUrl);
metaDao.merge(entity);
}
}
}
}