This section contains a few unorganized tips on Object/Relational modeling in Cayenne. Some of these tips may become obsolete in the future as the Modeler evolves, making many things more transparent to the user.

  • Pay attention to validation messages when saving the project, this helps preventing lots of runtime errors. Click on the error message to go to the problem spot.
  • All DbRelationships must have reverse relationships.
  • You do not need to map meaningless primary key columns (like autogenerated sequential numbers) to ObjAttributes. Unless you absolutely need them, exclude them from the object model, and Cayenne will do the right thing for you.
  • Even if you work with an existing database schema, special database objects may need to be created to support automated primary key generation.
  • Display order of attributes and relationships is alphabetic and does not affect Cayenne runtime behavior.
  • Display order of Procedure Parameters is important - this is the order in which stored procedure parameters will be bound. Use "Up" and "Down" buttons in the bottom of the "Parameters" tab to change parameter position.