crawljax/crawljax — pull request #134 by alexnederlof (2013-02-15 18:58:00+00:00)
Title: Mockup for the database

This pull request is for @ryansolid

It has al the boilerplate for a database connection. I added the person class as an example.

Browse to [http://localhost:8080/rest/person]() to see the list of persons. Browse for example to [http://localhost:8080/rest/person/add?first=ryan&last=solid]() to add a user.

A couple of remarks:

* All changes to the database *must* go via liquibase.xml. For examples, read their docs or checkout the [DevHub](https://github.com/devhub-tud/DevHub/) project.
* All methods that use the database have to be annotated with `@Transactional`. This only has to be done at 'the entrance' so all submethods don't need to be annotated.
* take a look at the person resource, how I get and create a new user. Note that the `id` field is automatically generated by the database.
* Note that that `persistence.xml` contains two units: one in-memory and one file-backed version of h2. The in-memory is for unit tests and is cleaned after every run. The other is for production.