Skip to content

Instantly share code, notes, and snippets.

@MaximilianoRicoTabo
Created February 11, 2016 22:42
Show Gist options
  • Save MaximilianoRicoTabo/c34ca7bb4c062e20a9fe to your computer and use it in GitHub Desktop.
Save MaximilianoRicoTabo/c34ca7bb4c062e20a9fe to your computer and use it in GitHub Desktop.
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_YEAR, -30);
Date d = cal.getTime();
Map<String, Object> params = new HashMap<String, Object>();
params.put("date", d);
List<Space> spaceWrapper= queryManager.runSelect("select distinct space"
+ " from com.teamhub.models.action.Action action"
+ " inner join action.spaces space"
+ " where action.actionDate > :date"
+ " group by space"
+ " order by COUNT(DISTINCT action.id) desc ", params, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment