This is a step-by-step tutorial showing how to write a database application with Cayenne. When you are done with it, you should have an understanding of the basics of object-relational mapping using CayenneModeler and how to use the Cayenne framework in standalone (command-line or otherwise) and web applications. The tutorial uses Maven, Eclipse IDE and Derby database, however it can be easily recreated with another combination of a database, an IDE and a build system. Full tutorial source code in a form of Eclipse project is distributed with Cayenne (see "tutorials/tutorial" folder).
|Note about Maven|
The only potentially controversial choice here is Maven. Not everybody is familiar with Maven, and not everybody likes it. However we decided that the benefits of the setup simplicity outweigh any downsides. Note that the tutorial is using m2eclipse plugin and doesn't even require a command-line Maven installation. Moreover most of the useful Cayenne Maven hackery is presented in boxed inserts throughout the text, while a Maven-agnostic alternative is shown in the main text.
- Setting up the environment...
- Learning mapping basics
- Learning Cayenne API
- Converting to web application...