コード例 #1
0
 public static ArrayList<Ranking> searchForRankings(HashMap<String, String> params) {
   ArrayList<Ranking> list = new ArrayList<Ranking>();
   ArrayList<ObjectModel> models = DatabaseDriver.find(Ranking.class, params);
   if (models != null) {
     for (ObjectModel model : models) {
       list.add(new Ranking(model.getData()));
     }
   }
   return list;
 }
コード例 #2
0
 public static Ranking getRankingById(int id) {
   try {
     ObjectModel model = DatabaseDriver.findById(Ranking.class, id);
     if (model != null) {
       return new Ranking(model.getData());
     }
   } catch (SQLException e) {
     // Do not care
   }
   return null;
 }