boolean found = false;
for (ItemLanguage language : master.getItemLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClass.getSiteProfileClassId())) {
found = true;
CompassItemLanguage compassItemLanguage = formatItemLanguage(master, language, siteDomain.getSiteDomainId());
compassSession.save(compassItemLanguage);
}
}
if (!found) {
CompassItemLanguage compassItemLanguage = formatItemLanguage(master, master.getItemLanguage(), siteDomain.getSiteDomainId());
compassItemLanguage.setSiteProfileClassId(siteProfileClass.getSiteProfileClassId());