Commit d1ff93c2 authored by Alessandro Portosa's avatar Alessandro Portosa
Browse files

Add ordering while loading domains by type

parent a1caa349
......@@ -78,12 +78,7 @@ public class DomainCRUD extends AbstractSpagoBIResource {
try {
domaindao = DAOFactory.getDomainDAO();
domains = domaindao.loadListDomainsByType(type);
Collections.sort(domains, new Comparator() {
@Override
public int compare(Object domain, Object otherDomain) {
return ((Domain) domain).getValueId().compareTo(((Domain) domain).getValueId());
}
});
if (type.equals("DIALECT_HIB")) {
filterDataSourceDomains(domains);
}
......
......@@ -118,8 +118,10 @@ public class DomainDAOHibImpl extends AbstractHibernateDAO implements IDomainDAO
tx = aSession.beginTransaction();
Criterion domainCdCriterrion = Expression.eq("domainCd", domainType);
Order valueIdOrder = Order.asc("valueId");
Criteria criteria = aSession.createCriteria(SbiDomains.class);
criteria.add(domainCdCriterrion);
criteria.addOrder(valueIdOrder);
List hibList = criteria.list();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment