Пример #1
0
  @Transactional
  public long sumeCoinsAsValue(User user) {
    long sum = 0;

    for (Coin coin : user.getCoins()) {
      sum += coin.getValue();
    }
    return sum;
  }
Пример #2
0
 @Transactional
 public void transferFoundCost(User peerUser) {
   peerUser.getCoins().add(new Coin(Coin.VALUE_FOUND));
 }
Пример #3
0
 public List<Coin> allCoins(User user) {
   return user.getCoins();
 }
Пример #4
0
 @Transactional
 public void transferSearchCost(User user) {
   user.getCoins().add(new Coin(Coin.VALUE_SEARCH));
 }