@Override
    public void addSortToSql(final SqlBuilder sql, final boolean sortDesc) {
        sql.addOrder(sql.getMainTableId() + ".visiteddate", !sortDesc);
    }
copy of Long#compare to avoid boxing
main/src/main/java/cgeo/geocaching/sorting/VisitComparator.java