4.2.2.3. Attribute

<attribute> is a sub element of <object> that 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 4.15 <attribute/> example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="https://metafactory.io/xsd/v1/model"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="https://metafactory.io/xsd/v1/model
                           https://metafactory.io/xsd/v1/model.xsd">

        <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 4.11 attributes of <attribute/>

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

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

The element <attribute/> contains no sub elements.