Datatype

Return to Introduction  Previous page  Next page

public Class

A Datatype is a named type that can be associated with attribute or method types. It typically is related to either code engineering or database modeling. Datatypes also indicate which language or database system they relate to. Accessed using the Repository Datatypes collection.

Associated table in .EAP file: t_datatypes

Datatype Attributes

Attribute

Type

Notes

Name

String

Read/Write. The datatype name (eg. integer). This appears in the related drop-down datatype lists where appropriate.

Type

String

Read/Write. The type can be DDL for database datatype or Code for language datatypes. 

Product

String

Read/Write. The datatype product - eg. Java, C++, Oracle. 

Size

Long

Read/Write. The datatype size.

MaxLen

Long

Read/Write. Maximum length (DDL only).

MaxPrec

Long

Read/Write. Maximum precision(DDL only).

MaxScale

Long

Read/Write. Maximum scale(DDL only).

DefaultLen

Long

Read/Write. Default length (DDL only.)

DefaultPrec

Long

Read/Write. Default precision(DDL only).

DefaultScale

Long

Read/Write. Default scale(DDL only).

UserDefined

Long

Read/Write. Indicates if datatype is a user defined type or system generated. Datatypes distributed with Enterprise Architect are all system. Datatypes created in the Datatype dialog are marked 1 (true). 

HasLength

String

Read/Write. Indicates datatype has a length component .

GenericType

String

Read/Write. The associated generic type for this data type.

DatatypeID

Long

Read/Write. Instance ID for this datatype within the current model. System maintained.

ObjectType

ObjectType

Read only. Distinguishes objects referenced through a Dispatch interface.

Datatype Methods

Method

Type

Notes

Update () 

Boolean 

Update the current Datatype object after modification or appending a new item. If false is returned, check the GetLastError function for more information.

GetLastError () 

String 

Returns a string value describing the most recent error that occurred in relation to this object.

This function is rarely used since an exception is thrown when an error occurs.