Changeset 7026


Ignore:
Timestamp:
Nov 25, 2015, 9:58:29 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1974: Sort project item list by name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.6-stable/src/core/net/sf/basedb/core/Project.java

    r7025 r7026  
    2828import net.sf.basedb.core.data.ItemParameterValueData;
    2929import net.sf.basedb.core.data.ItemSubtypeData;
     30import net.sf.basedb.core.data.NameableData;
    3031import net.sf.basedb.core.data.ProjectData;
    3132import net.sf.basedb.core.data.ShareableData;
     
    3435import net.sf.basedb.core.query.Restrictions;
    3536import net.sf.basedb.core.query.Hql;
     37import net.sf.basedb.core.query.Orders;
    3638import net.sf.basedb.core.query.EntityQuery;
    3739import net.sf.basedb.core.query.ResultList;
     
    592594        hql.select(Selects.expression(Hql.alias("item"), null, true));
    593595        if (restriction != null) hql.restrict(restriction);
     596        if (NameableData.class.isAssignableFrom(item.getDataClass()))
     597        {
     598          hql.order(Orders.asc(Hql.property("name")));
     599        }
     600        hql.order(Orders.asc(Hql.property("id")));
    594601        /*
    595602          SELECT item[.id]
Note: See TracChangeset for help on using the changeset viewer.