CBE Examples on GitHub

Cayenne by Example

Illustrating some of the major features of the Apache Cayenne ORM framework using simple examples.

Download this project as a .zip file Download this project as a tar.gz file

Inserting Objects

These examples will show how to create new Java objects and register them in a DataContext, set their values, and commit to the database.

The examples will progress in complexity as more and more data is used to build a database to use for the later examples on fetching, updating, and deleting.

NOTE: The first example shows more detail than most, including what Cayenne-generated classes look like and detailed SQL/startup logs, since it is the introductory example.

Inserting Objects Examples: