Skip to content
logoBack to home screen

Constraint Metadata

The package Constraint gathers together all metadata which affect model components: either a entity type or property.

General

Using any of the constraint metadata means that the standard behavior for either a property or entity is changed in some way. One such example is the String Regex Constraint, which only allows strings matching a specific regular expression to be committed.

You can only apply a constraint to an entity or a property.

The main type is Constraint, which defines all the main properties for all constraint metadata, and is used to define two subtypes:

  • Entity Constraint
  • Property Constraint

In addition to this, the Entity Constraint and Property Constraint extend their respective metadata types (EntityTypeMetadata and PropertyMetadata), so that all individual metadata belonging to Constraint have all the required inherited, as well as their own specific, properties.

Available Metadata

NameDescription
Cascading DeleteAllows to you delete actual entity instance in a chain. For example, if you have an entity which contains a collection property, and this metadata is set to true, deleting said entity also deletes the entities contained in the collection.
Confirmation, DynamicConfirmation and StaticConfirmationAllows to display a confirmation message to the user prior to executing some service request.
Deployable ComponentDefines a base type which you can associate an concrete expert interface for.
BidirectionalThis metadata creates a relationship between two properties, so that when one is defined with a new value, the second property is automatically updated.
Date ClippingYou can use this metadata to influence how a tribefire's general date and time is displayed.
Deletable and NonDeletableCan be used to enable/disable the deletion of an entity.
Instantiable and NonInstantiableDetermines whether or not you can create a new entity instance when assigning a value to a single aggregation property.
Mandatory and OptionalDefines whether a property must have a value before saving or not.
Message, DynamicMessage and StaticMessageAllows to display a custom message to the user while awaiting for the execution of some service request.
Min and MaxSets a boundary on a decimal value. This can metadata can provide either a max or min value for this number.
MinLength and MaxLengthDetermines the min and max length of a property.
Modifiable and UnmodifiableThese metadata allow you to configure whether an element can be edited after instantiation.
PatternAllows you to define a regular expression that must be met before the instance can be committed.
Referenceable and NonReferenceableThis defines whether you can define this property with an existing entity instance.
Unique and NonUniqueDefines whether the value of this property should be unique against all other instances of the same property in a model.