I am following this tutorial, which is the easiest Java EE web app using JPA I found on the net after weeks of searching, and I’d like to add a remove method to the DAO but I don’t know exactly how to do it.
Here the code I’ve added to the DAO class:
Player player = em.find(Player.class);
em.remove(player);
Is it possible to add CRUD functionality? I want keep the code as simple as possible.
It is certainly possible and you already have one half of that code, so it shouldn’t be so difficult to create a method which does that:-) Just put this in your bean
Try to read something about JPA, it’s no so hard to learn(unless you go really deep) and you are asking here something what you could have googled in two minutes:-)