コード例 #1
0
 public Player save(Player player) {
   sessionFactory.getCurrentSession().persist(player);
   if (findOne(player.getFirstName()) != null) {
     playerList.remove(findOne(player.getFirstName()));
   }
   playerList.add(player);
   // serialiseList();
   return player;
 }
コード例 #2
0
 public Player findOne(String playerId) {
   syncListWithDB();
   for (Player playerCurrent : playerList)
     if (playerCurrent.getFirstName().equals(playerId.replace("%20", " "))) return playerCurrent;
   return null;
 }