Getting Started with Cayenne


Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Table of Contents

I. Setting up the environment
1. Setup
Install Java
Install Eclipse IDE and the Maven Plugin
II. Learning mapping basics
2. Starting a project
Create a new Project in Eclipse
Download and Start CayenneModeler
Create a New Mapping Project in CayenneModeler
Create a DataNode
Create a DataMap
Save the Project
3. Getting started with Object Relational Mapping (ORM)
Mapping Database Tables and Columns
Mapping Database Relationships
Mapping Java Classes
4. Creating Java Classes
Creating Java Classes
III. Learning Cayenne API
5. Getting started with ObjectContext
Creating the Main Class
Running Application
6. Getting started with persistent objects
Inspecting and Customizing Persistent Objects
Create New Objects
7. Selecting Objects
Introducing SelectQuery
8. Deleting Objects
Setting Up Delete Rules
Deleting Objects
IV. Converting to Web Application
9. Converting to Web Application
Converting Tutorial to a Web Application
Running Web Application