Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public GameStatistic getBestGameHitPercentage (String gameType, String verbTense) throws Exception
- {
- HeadersManager.getInstance().addHeader( HeadersManager.HeadersEnum.USER_TOKEN_KEY, InvocationContext.getUserToken());
- BackendlessDataQuery dataQuery = new BackendlessDataQuery("gameType = '" + gameType + "' AND verbTense = '" + verbTense + "'");
- QueryOptions options = new QueryOptions();
- List sortBy = new ArrayList<String>();
- sortBy.add(HIT_PERCENTAGE_SORT_ORDER);
- sortBy.add(TIME_IN_SECONDS_SORT_ORDER);
- options.setSortBy(sortBy);
- options.setPageSize(1);
- dataQuery.setQueryOptions(options);
- BackendlessCollection gameStatistics;
- try {
- gameStatistics = Backendless.Persistence.of(GameStatistic.class).find(dataQuery);
- }
- catch (BackendlessException exception)
- {
- throw exception;
- }
- catch (Exception exception)
- {
- logger.error("Exception: " + exception);
- throw exception;
- }
- GameStatistic statistic = (GameStatistic) gameStatistics.getData().get(0);
- return statistic;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement