Datatype

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

DatatypeID

Long

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

DefaultLen

Long

Read/Write. Default length (DDL only).

DefaultPrec

Long

Read/Write. Default precision (DDL only).

DefaultScale

Long

Read/Write. Default scale (DDL only).

GenericType

String

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

HasLength

String

Read/Write. Indicates datatype has a length component.

MaxLen

Long

Read/Write. Maximum length (DDL only).

MaxPrec

Long

Read/Write. Maximum precision (DDL only).

MaxScale

Long

Read/Write. Maximum scale (DDL only).

Name

String

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

ObjectType

ObjectType

Read only. Distinguishes objects referenced through a Dispatch interface.

Product

String

Read/Write. The datatype product, such as Java, C++, Oracle.

Size

Long

Read/Write. The datatype size.

Type

String

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

UserDefined

Long

Read/Write. Indicates if datatype is a user defined type or system generated.

Datatypes distributed with Enterprise Architect are all system generated. Datatypes created in the Datatype dialog are marked 1 (true).

Datatype Methods

Method

Type

Notes

GetLastError ()

String

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

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

Update ()

Boolean

Updates the current Datatype object after modification or appending a new item.

If false is returned, check the GetLastError function for more information.