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.
2. Choose Model > Switch Adaptor.
3. Select JDBC from the list of adaptors.
4. Enter the JDBC connection dictionary information. For help setting the Oracle JDBC connection dictionary, see technical document 75145, "WebObjects 5: How to use Oracle JDBC Drivers". For other databases, consult your JDBC driver documentation.
5. Save the new model file.
6. Close the model file.
7. Verify the connection dictionary is set correctly.
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:
2. Switch the Adaptor type to "none"
3. Save the model file.
4. Open the modified model file using the EOModeler from WebObjects 5
5. Complete the conversion process described in sections Setting the Connection Dictionary and Setting the Correct Attributes.
Steps if only WebObjects 5 Development Environment is available:
Mac OS X
2. Choose Show Package Contents from shortcut menu. (Control-click the file's icon). A new Finder window appears with an index.eomodeld file.
3. Open the index.eomodeld file using TextEdit.
4. Locate the line that contains "adaptorName = your_old_adaptor".
5. Change your_old_adaptor to JDBC.
6. Save the file, then restart EOModeler. EOModeler can now open the modified model file.
7. Complete the conversion process described in sections Setting the Connection Dictionary and Setting the Correct Attributes.
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.