update(ejb);
}
}
public void updateUserInvestment(UserDTO user){
Investment ejb = manager.find(Investment.class, user.getSsn());
if( ejb == null ){
ejb = user.getInvestmentDetails().toEJB(user.getSsn());
persist(ejb);
} else {
ejb.setCapitalgains(user.getInvestmentDetails().getCapitalGains());
ejb.setCapitallosses(user.getInvestmentDetails().getCapitalLosses());
ejb.setStockdividends(user.getInvestmentDetails().getStockDividends());
update(ejb);
}
}