Query query = em.createQuery(sql);
query.setParameter("siteId", siteId);
query.setParameter("categoryParentId", categoryParentId.longValue());
Iterator<?> iterator = query.getResultList().iterator();
while (iterator.hasNext()) {
Category category = (Category) iterator.next();
CategoryLanguage categoryLanguage = null;
for (CategoryLanguage language : category.getCategoryLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
categoryLanguage = language;
}
}
DropDownMenu childMenus[] = makeDdmCategory(siteId, category.getCatId(), siteProfileClassId, siteProfileClassDefaultId);
DropDownMenu ddm = new DropDownMenu();
ddm.setMenuKey(Format.getLong(category.getCatId()));
ddm.setMenuName(categoryLanguage.getCatShortTitle());
if (siteProfileClassId != siteProfileClassDefaultId) {
Iterator<?> categoryLanguages = category.getCategoryLanguages().iterator();
boolean found = false;
while (categoryLanguages.hasNext()) {
categoryLanguage = (CategoryLanguage) categoryLanguages.next();
if (categoryLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
found = true;