A field type defines a field within a {@link Record}. Each field added to a record should be defined as a field type.
A field type exists on its own (separate from any RecordType), but is typically associated with one or more {@link RecordType}s.
Field types are managed via the {@link TypeManager}. To instantiate a field type use {@link TypeManager#newFieldType(ValueType,QName,Scope) TypeManager.newFieldType}. As all entities within this API, field types are dumb data objects.
A field type has two unique identifiers:
- a system-generated id, immutable after creation of the field type
- a name in the form of a {@link QName qualified (namespaced) name}, which is mutable after creation of the field type
Each field type has a scope, the fields of a field type are said to belong to that scope. Scopes are explained in detail in the Lily documentation.
In contrast with {@link RecordType}s, field types are not versioned. In fact, field types are almost immutable, only their name can be changed after creation.