Project

General

Profile

« Previous | Next » 

Revision 41983

Added by Eri Katsari about 8 years ago

fix for ordering on dates

View differences:

ResultRepo.java
1 1
/**
2
 * Created by eri_k on 2/20/2016.
2
 * Created by Glykeria Katsari on 2/20/2016.
3 3
 */
4 4
package eu.dnetlib.usagestats.repos;
5 5

  
......
15 15
import java.util.ArrayList;
16 16
import java.util.List;
17 17

  
18
//@RepositoryRestResource(collectionResourceRel = "resultStats", path = "resultStats")
19 18
@Repository
20 19
public class ResultRepo extends BaseRepository {
21 20
    private Logger log = Logger.getLogger(this.getClass());
......
47 46
    public List<UsageStats> getPopularityOverTime(String resultId) {
48 47

  
49 48
        String query = "select rs.resultid, rs.timestamp_month , rs.numberofviews from  usagestats.resultsstats rs " +
50
                " where rs.resultid=?  order by rs.timestamp_month  desc ;";
49
                " where rs.resultid=?  order by to_date(rs.timestamp_month,'MM/YYYY') ;";
51 50
        List<String> values = new ArrayList<String>();
52 51
        values.add(resultId);
53 52
        return executePreparedQuery(query, values);

Also available in: Unified diff