Sample project of a basic RESTful application with Maven using the new JAX-RS 2.0 API of JEE7 and default persistence configuration of Glassfish4.
Check the blog for detailed information: http://extendsobject.blogspot.com/2013/09/jax-rs-20-using-json-and-persistence.html
You can use the built-in Derby database provided by Glassfish with 'asadmin start-database'.