コード例 #1
0
 /**
  * Return a page of Performance
  *
  * @param page Page to display
  * @param pageSize Number of computers per page
  * @param sortBy Computer property used for sorting
  * @param order Sort order (either or asc or desc)
  * @param filter Filter applied on the name column
  */
 public static Page<Performance> page(
     int page, int pageSize, String sortBy, String order, String filter) {
   return find.where()
       .ilike("name", "%" + filter + "%")
       .orderBy(sortBy + " " + order)
       .fetch("INSERT FOREIGN KEY NAME")
       .findPagingList(pageSize)
       .getPage(page);
 }
コード例 #2
0
 /**
  * Returns the PerformanceID of given performance time
  *
  * @param performanceTime Which subversion number to find ID for
  * @return id of Performance. Creates new one if no performanceTime already existed
  */
 public static Long getPerformanceID(String performanceTime) { // Used in saveRun
   Performance performance = find.where().eq("time", performanceTime).findUnique();
   if (performance == null) { // If no Performance was found... add it and return that id
     Performance newPerformance = new Performance();
     newPerformance.time = performanceTime;
     newPerformance.save();
     return newPerformance.id;
   }
   return performance.id;
 }