Apache Cayenne > Index > Cayenne Examples > Generic DataObjects Example

This example shows how to use generic entities. It shows how to map them in the Modeler, how to extend them in runtime, and how to perform common Cayenne operations. For more information see Generic Persistent Class article.

How to Run

  • Download the example and unpack it somewhere.
  • generic-mapping-example folder you end up with is a self-contained Eclipse project, including Cayenne 1.2M9 jar and HSQLDB jar. Just import the folder in Eclipse (Eclipse 3.1 or newer is recommended).
  • From Eclipse run cayenne.example.generic.Main class as "Java Application". As in-memory HSQLDB is used, Cayenne generates the schema on the fly and no extra DB setup is required.