WebObjects 5: How to Convert WebObjects 4.5 EOModel Files to WebObjects 5

This document describes how to convert WebObjects 4.5 EOModel files into a compatible format for WebObjects 5.
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, these model files need to be converted to a compatible format depending on the type of adaptor you have selected (JDBC or JNDI).

This document provides the steps needed to convert WebObjects 4.5 EOModel files into WebObjects 5 EOModel files for the JDBC adaptor and supported databases. See technical document 72598 "WebObjects Compatibility Guide" for additional information on the list of supported databases for each WebObjects version.


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.


Re-open the model file and choose Model > Set Adaptor Info.

WebObjects 5.0 Only

Do not use the inspector to see the connection dictionary on the root item in the entity list. If you do, you must quit EOModeler and re-open the model file before you can switch to a new adaptor, or set a new connection dictionary (Apple Reference 2700580). This issue only occurs in WebObjects 5.0, and has been corrected in WebObjects 5.0 Update 1 as well as WebObjects 5.1 and WebObjects 5.2.

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.

Additional reference:

For a complete discussion of value types, see (http://developer.apple.com/techpubs/webobjects/UsingEOModeler/4WorkingWithAttributes/chapter_4_section_11.html).

Known Issues With Attribute Settings

Converting Oracle CHAR types to JDBC

Check that EOModeler does not convert string attributes of CHAR types into VARCHAR2 or VARCHAR. In addition to the CHAR external type, you also need to manually set the JDBC value type to 'c'.

Converting Oracle9i TIMESTAMP type to JDBC (WebObjects 5.2 only)

Apple Reference 3157719

Using the Oracle 9.2.01 JDBC Driver, EOModeler incorrectly reverse engineers the TIMESTAMP external data type to an internal type NSData.

Manually fix this issue by using the following settings:

External type: TIMESTAMP

Internal type: NSTimestamp

Value type: T

Important: Installing WebObjects 5.2.1 resolves this issue. Using WebObjects 5.2.1, EOModeler can now correctly handle the Oracle 9i external time TIMESTAMP

Converting DATE's from OpenBase (in WebObjects 4.5/4.5.1) to JDBC

Apple Reference 2712976

WebObjects 5.0

When switching your adaptor from OpenBase to JDBC, make sure 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.

WebObjects 5.1 or WebObjects 5.2

This issue has been corrected in WebObjects 5.1 and 5.2. To convert DATES from OpenBase to JDBC, use the following settings:

External type: datetime

Internal type: NSTimestamp

Value type: T

----------------------------

External type: date

Internal type: NSTimestamp

Value type: D

Troubleshooting

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

If WebObjects 4.5 or 4.5.1 Development Environment is available:


Steps if only WebObjects 5 Development Environment is available:

Mac OS X


Microsoft Windows 2000
Published Date: Feb 20, 2012