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:
- Basic Inserts
- Enumerations
- To-One Relationships
- To-Many Relationships
- Many-to-Many Relationships
- Flattened Relationships
- To-Dependent PK
- Meaningful PKs
- Callbacks
- Listeners
- Embeddables
- BLOBs
- Validation