@Transactional public long sumeCoinsAsValue(User user) { long sum = 0; for (Coin coin : user.getCoins()) { sum += coin.getValue(); } return sum; }
@Transactional public void transferFoundCost(User peerUser) { peerUser.getCoins().add(new Coin(Coin.VALUE_FOUND)); }
public List<Coin> allCoins(User user) { return user.getCoins(); }
@Transactional public void transferSearchCost(User user) { user.getCoins().add(new Coin(Coin.VALUE_SEARCH)); }