Chapter 8 O/R Mapping Modeling


Attribute transformation

You can transform an attribute into a column. To do so you must select the Persistent option in the Detail tab of the attribute property sheet.


Persistent attributes can have simple data types or complex data types.

Simple data type

The simple data type is based on standard data types, such as int, float, String, Date etc. Each persistent attribute is transformed into one column. Its data type is converted into an internal standard data type. The internal standard data type is then mapped to a specific data type of the physical database.

The following table list the correspondence between simple data types supported Java and internal standard data types.

Java data type Standard data type Description
String VA254 Variable character with 254 max length
Date DT Date time
Object ANY Default data type
Boolean BL Two opposing values (true/false; yes/no; 1/0)
Integer I 32 bit integer
Short SI 16 bit integer
Long LI 64 bit integer
Float F 32 floating point numbers
Double N Numbers with a fixed decimal point
Character A1 Character with 1 length
Byte BT 256 values
Number N Numbers with a fixed decimal point
StringBuffer TXT Character strings
Thread ANY Default data type
ThreadGroup ANY Default data type
Process ANY Default data type

The following table list the correspondence between simple data types supported C# and internal standard data types.

C# data type Standard data type Description
Array ANY Default data type
Boolean BL Two opposing values (true/false; yes/no; 1/0)
Byte BT 256 values
Char TXT Character strings
DateTime DT Date time
TimeSpan T Time
Decimal DC Decimal
Double LF 64 floating point numbers with double precision
Int16 SI 16 bit integer
Int32 I 32 bit integer
Int64 LI 64 bit integer
Object ANY Default data type
SByte BT 256 values
Single F 32 floating point numbers
String VA254 Variable character string with 254 max length
UInt16 SI 16 bit integer
UInt32 I 32 bit integer
UInt64 LI 64 bit integer

These standard data types will be translated into data types supported by the DBMS of your PDM. You can refer to the database definition for the translation rules.


You can also customize the code of the generated data types in the Code box of the Persistent groupbox. You can also customize the code of the generated columns.

Attribute mapping will be generated for the attribute.

Complex data type

The complex data type is based on a classifier. The transformation depends on the persistent settings of the classifier. The classifier is generally used as a value type class. For more information, see Value type transformation.

 


Copyright (C) 2006. Sybase Inc. All rights reserved.