void (Player player, Session ses, UserCashOut userCashOut, double checkAmount) { Check check = new Check(); check.setAmount(checkAmount); check.setCreateDate(new Date()); check.setPlayer(player); player.getChecks().add(check); check.setUserCashOut(userCashOut); userCashOut.setCheck(check); Transaction transaction = new Transaction(); transaction.setAmount(-checkAmount); transaction.setCreateDate(new Date()); transaction.setProcessDate(new Date()); transaction.setType(TransactionType.CASHOUT); transaction.setStatus(TransactionStatus.PENDING); transaction.setPlayer(player); check.setTransaction(transaction); transaction.setCheck(check); ses.save(transaction); ses.save(check); }