Skip to main content

Reference

Instead of generating values, a reference applies an existing property value from another entity. It can be used for defining a foreign key reference between two entities. A reference has three properties:

  • entity: [required] Defines the target entity.
  • property: [required] Defines the target property.
  • linked: Specifies a linked property value to be referenced. This is useful when multiple properties within the same entity reference the target entity. It ensures that referencing properties always correspond to the same record in the target entity.
Regular Reference
    # product_id references the id property of the product entity
- name: "order_detail"
properties:
- name: "product_id"
type: "sequence"
reference:
entity: "product"
property: "id"
warning

The data type of the referencing and referenced properties must match.