Mode complex example using Java Persistence API.