Previous Next

Value Type

When you choose a value class for a particular attribute, you sometimes do not provide Enterprise Objects with all the information the JDBC adaptor needs to negotiate with the data source.

For example, when you specify Number as the value class for a particular attribute, you are telling Enterprise Objects to use java.lang.Number, which is an abstract class. This is where the value type characteristic steps in. It specifies the exact class an attribute should map to.

The possible value types for numeric attributes are as follows(note case):

The value type also specifies which JDBC methods are used to send and retrieve the data to and from the database. These value types affect which method the java.sql.PreparedStatement object uses to transfer text data between the database and the JDBC adaptor. For attributes with a value class of String, the following value types are defined:

Database columns of type char hold string values that are right-padded with spaces to the width of the column. String values in Enterprise Objects, however, normally do not have trailing spaces for performance and other efficiency reasons. An attribute that maps to an external type of char should have a value type of c to tell the JDBC adaptor to trim trailing spaces when fetching values that correspond to that attribute. If the value type is left blank for attributes that map to an external type of char, then no trimming occurs. Attributes that map to varchar columns are never trimmed, regardless of value type.

S is the appropriate value type for most text columns. C is good for columns that usually contain large amounts of data. c should be used when trailing spaces are not significant in a char column. It is not recommended to use E, except when absolutely necessary. It is the database’s responsibility to handle text encoding issues and using E usually indicates that the database is not properly configured.

For attributes with a value class of NSTimestamp, the following value types are defined:




Previous Next


© 2002 Apple Computer, Inc. (Last Updated November 2002)