TITLE
    WebObjects 4: Database Save Problem with Custom Data Types in Java
Article ID:
Created:
Modified:
70087
7/23/99
8/6/99

TOPIC

    Custom Value Coding allows developers to create their own custom data types. These data types can then be assigned as an attribute's data type in an Enterprise Object (EO) and stored in the database like any other supported data type. General information about creating custom data types can be found in the EOF Developer's Guide, pp. 111-113. This article describes a problem that developers may encounter when using custom data types in Java.


DISCUSSION

    Currently, a straightforward application of custom data types as described in the Developer's Guide will have a problem when implemented in Java. Specifically, saving an Enterprise Object with a custom data type attribute to the database will result in a java,lang,CloneNotSupportedException. The solution is to implement your own clone() method in the custom data type's class. As with the java.lang.Object.clone() your method must return a new instance of the class. Any manipulation or selection of the custom data object can also be accomplished in the clone() method.


Document Information
Product Area: WebObjects
Category: WebObjects 4
Sub Category: Development

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