Complex types
Complex types represent structured data. The following model shows the most common field forms in one extractable example:
cmn
package com.example.customer
import org.joinedworkz.facilities.common.base
platform Base
type Address {
city*: String
}
type Employee {
id**: Id
name*: String
}
type Person {
firstName*: Name
lastName*: Name
}
type Customer {
id**: Id
address: Address
manager -> Employee
orders: Id[]
tags: String[0..*]
translations: String[String]
}
type CustomerView {
...Person
...Customer exclude manager
}Field forms
name*: Stringis a mandatory containment field.id**: Idis a key field.address: Addresscontains another complex type.manager -> Employeereferences another complex type.orders: Id[]is an unbounded collection.tags: String[0..*]states the bounds explicitly.translations: String[String]is a dictionary keyed byString....Personincludes fields from another type....Customer exclude managerincludes fields except the named field.
Without *, a field is optional. Cardinalities follow the referenced type.
