5.2.2.3. Attribute

<attribute> is a sub element of <object>. <attribute> defines the attributes belonging to the scope of the parent object in the model.

Inside this object scope the name of the attribute has to be unique. An object can contain any number of attributes. If the object for which the attributes are defined has properties then the attributes have to be placed after the properties.

Listing 5.16 <attribute/> example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<model>
        ...

        <package name="yourModelPackage">
                ...
                <object name="yourObjectName01">
                        ...

                        0 or more <attribute name="yourAttribute01" type="string" notnull="false"></attribute>
                </object>
                ...
        </package>

        ...
</model>

Syntax

<attribute name=”” type=”” length=”” notnull=””> </attribute>

Attributes

Table 5.18 attributes of <attribute> you like the name?

Name

Details

Required

name

The attribute name has to be unique within the scope of the object.

mandatory

type

Data type of this attribute: [String, integer, Integer, boolean, Boolean, void, Date, DateTime, long, Long, double, Double, blob, clob, short, Short, float, Float, big_decimal, character, byte, Byte, yes_no, time, timestamp, calendar, calendar_date, binary, text]

mandatory

length

Question S

optional

notnull

This flag attribute tells whether its attribute property is allowed to be undefined (notnull=’FALSE”) or not (notnull=”TRUE”). This attribute defaults to notnull=”FALSE”

optional

Sub elements

Table 5.19 sub elements of <attribute>

Name

Details

Number

metadata

With metadata the code instruction logic can make decisions. The logic can also add metadata itself.

0 .. n