This post describes how to create an simple Entity and Session bean with EJB3.1. As some of you know EJB 3.1 is ready to use and makes the world much easier for the developers. No more xml configuration files except “persistence.xml”. Everything can be done using annotations and if you decide to use xml configuration files they overrule the annotations.
I am telling you using EJB now is as easy as programming POJOs. This is how you define an simple Entity bean.
And this is how you define an simple Session bean.
To be able to save the entity you need some kind of an persistence, this is an example of the persistance.xml
This is it, this is all you need to create an ejb jar file that is deployable to the server.