Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOF Tools and Techniques

Table of Contents Previous Section

Setting Adaptor Information

A model includes a connection dictionary, which contains the information needed to connect to a database server. The keys of the connection dictionary identify the information the server expects, and the values associated with those keys are the values that the adaptor tries when logging into the database.

When you initialize an adaptor from a model, any connection information stored with the model is copied into the adaptor object.

The connection dictionary contains the last values you entered in the login panel and saved as a part of your model (so long as you haven't manually edited the connection dictionary in your model file). You can change the connection dictionary's values from EOModeler; this is called setting adaptor information.

To set adaptor information:

  1. Choose Model Set Adaptor Info.

    EOModeler displays a login panel that contains values taken from the model's connection dictionary.

  2. In the login panel, make the edits you want reflected in your connection dictionary, and click OK.
For example, if you specified a user name and password to log into a database and create your model, you can remove that information from the connection dictionary by clearing those fields in the login panel. Then, in your application, you can prompt the user for a user name and password by sending a runLoginPanelAndValidateConnectionDictionary message to your adaptor object.

You can also edit the connection dictionary in its raw form using the Connection Dictionary Inspector. This provides you access to connection dictionary entries that the login panel doesn't configure. To use the Connection Dictionary Inspector, select the model icon in the Model Editor, and display the Inspector.

Figure 48. Connection Dictionary Inspector

For more discussion of how Enterprise Objects Framework manages database connections and connection dictionaries, see the chapter "Connecting to the Database" in the book Enterprise Objects Framework Developer's Guide.

Switching Adaptors

You can change the database and adaptor your model is based on. To do so:

  1. Choose Model Switch Adaptor.

    This displays a New Model panel listing all the available adaptors.

  2. Select the adaptor you want to switch to and click OK.

    EOModeler displays the login panel for the database that corresponds to the adaptor you selected.

  3. Fill in the login panel and click OK.
When you switch adaptors, Enterprise Objects Framework automatically updates the mapping between the internal and external (database) types to work with the new adaptor's database.

Table of Contents Next Section