Create DataNode

Create DataNode. DataNodes are created under parent DataDomains. To create a DataNode, select one of the DataDomains on the left-hand side, and then select "Project -> Create DataNode" menu item or click on "New DataNode" icon. A new DataNode will be created under the selected domain. After the DataNode is created, you can assign it any name you want instead of the default "[DomainName]Node".

Configure DB Adapter. As mentioned in Cayenne User Guide, RDBMS engines sometimes require special handling outside of standard JDBC scope. Cayenne abstracts it via database-specific adapters. An adapter must be selected from a "DB adapter" dropdown, regardless what type of DataSource factory (see below) is used . Standard adapters distributed with Cayenne (including a generic JDBCAdapter) are listed in the dropdown. If you created your own adapter, type the full class name of a class that implements DbAdapter interface instead.

If entering custom DbAdapter results in Modeler showing a warning, it is likely a CLASSPATH issue. In this case you will need to setup the location of compiled custom adapter classes in "Tools > Preferences > ClassPath".

Select Local DataSource. This is an optional, though recommended step. A "Local DataSource" dropdown allows to create an association between a DataNode and a previously configured DataSources. Such association is transparently stored as one of the preferences and does not affect your project XML files. This is a good way to separate database connection info stored in a given Cayenne project (i.e. deployment information) from local preferred connection settings. Also it allows to connect using JNDI DataNodes.

Configure DataSource Factory. Depending on how you plan to deploy your Cayenne project, make a selection from the "DataSource Factory" dropdown. Select JNDIDataSourceFactory if you plan to obtain DataSource via JNDI from deployment container. If you either have a standalone application or want Cayenne to handle connection pooling, select DriverDataSourceFactory (default). A custom factory can also be used.

Configure DataSource Information (Driver factory only). Depending on the type of DataSource Factory selected, bottom right area of the screen will change to show a form appropriate for a selected type of DataSource. It allows to enter JDBC information for DriverDataSourceFactory or JNDI name for JNDI. If custom DataSource Factory was selected, an optional string parameter can be entered (it can be anything that a custom DataSource factory understands).