TITLE
    WebObjects 5: How to Convert WebObjects 4.5 EOModel Files to WebObjects 5.0
Article ID:
Created:
Modified:
75149
6/21/01
6/22/01

TOPIC

    This article describes how to convert WebObjects 4.5 EOModel files into a compatible format for WebObjects 5.0.


DISCUSSION

    Overview

    WebObjects 4.5/4.5.1 provides a choice of adaptors depending on your development platform, such as Sybase, Infomix, Oracle, or FlatFile adaptor. In WebObjects 5.0 there is only one choice of adaptor, JDBC, so WebObjects 4.5 EOModel files need to be converted manually.

    This article provides the steps needed to convert WebObjects 4.5 EOModel files into WebObjects 5.0 EOModel files.

    Setting up the New Connection Dictionary

    The EOModeler should always start from a known good state before converting EOModels. The best way to do this is to quit the WebObjects 5 EOModeler, if open, before proceeding with the conversion steps listed below.


      1. Open a 4.5 EOModel file with WebObjects 5 EOModeler.

      Important : Do not click on any item in the model file since the adaptor used in WebObjects 4.5 is not available in WebObjects 5.0.

      2. Choose Switch Adaptor from the Model menu.

      3. Select JDBC from the list of adaptors.

      4. Enter the JDBC connection dictionary information.

      For help setting the Oracle JDBC connection dictionary, see article 75145, " WebObjects 5: How to Use Oracle JDBC drivers "

      5. Save the new model file.

      6. Close the model file.

      7. Verify the connection dictionary is set correctly.
      Re-open the model file and choose Set Adaptor Info from the Model Menu.

      Important: Do not use the inspector to see the connection dictionary on the root item in the entity list. There is a known issue, Apple Reference 2700580, if you do this that requires you to quit EOModeler and re-open the model file before you can switch to a new adaptor, or set a new connection dictionary.


    Setting the Correct Attributes

    After completing Step 1 in Setting up the New Connection dictionary for each entity in the model file, use the Add Column pop-up menu in the Attributes window, and add the column "Value Class (Java)" and "Value Type" to make the Value Type and Value Class visible. The Value Type needs to be set for any object whose superclass is Number. For example, if the Java Class for the attribute is BigDecimal, then the JDBC Value Type should be set manually to B.

    Converting DATES from OpenBase (in WebObjects 4.5/4.5.1) to JDBC

    Important: When switching your adaptor from OpenBase to JDBC, ensure the external type for the date attributes are defined as "datetime". If they are not, make the appropriate change in the model and in the database. Otherwise, an INSERT operation will fail. This is a known issue, Apple Reference 2712976 .

    Troubleshooting

    If a WebObjects 4.5 model file fails to open with the WebObjects 5 EOModeler Tool

    Steps if WebObjects 4.5 or 4.5.1 Development Environment is available:


      1. Open the model file using the EOModeler from WebObjects 4.5.

      2. Switch the Adaptor type to "none"

      3. Save the model file.

      4. Open the modified model file using the EOModeler from WebObjects 5.0

      5. Complete the conversion process described in sections Setting the Connection Dictionary and Setting the Correct Attributes .


    Steps if only WebObjects 5.0 Development Environment is available:

    Mac OS X


      1. Locate the Model file in the Finder.

      2. Press Control and click the file's icon.

      3. Choose Show Package Contents from the contextual menu. A new Finder window appears with an index.eomodeld file.

      4. Open the index.eomodeld file using TextEdit.

      5. Locate the line that contains "adaptorName = your_old_adaptor".

      6. Change your_old_adaptor to JDBC.

      7. Save the file, then restart EOModeler. EOModeler can now open the modified model file.

      8. Complete the conversion process described in sections Setting the Connection Dictionary and Setting the Correct Attributes .


    Microsoft Windows 2000

      1. Open the index.modeld file for your model using TextEdit.

      2. Find the line that contains "adaptorName = your_old_adaptor".

      3. Change your_old_adaptor to JDBC.

      4. Save the file, then restart EOModeler. EOModeler can now open the modified model file.

      5. Complete the conversion process described in sections Setting the Connection Dictionary and Setting the Correct Attributes .



Document Information
Product Area: WebObjects
Category: WebObjects 5.0
Sub Category: Development
Keywords:

Copyright © 2000 Apple Computer, Inc. All rights reserved.