In order to generate code for EJB 3 persistence, you must.
Download an EJB 3 persistence provider such as Hibernate Entity Manager, Kodo, TopLink and GlassFish.
Define an environment variable to specify the location of the persistence library directory.
Generate code - define model selection and generation options and preview generated file list.
Run unit test.