Skip to content

PQA016 — Id property not found

An entity's id: names a property the entity does not declare.

id: marks which property is the entity's natural key — the value the data carries and the differ pairs on. It is a reference to a property name, not a value.

- entity: Card
  id: card_no             # the property is card_number
  properties:
    card_number:
      type: ulong

Why the build refuses this

Pairing loses its key. The differ compares entities by their natural key; a key that names no property has nothing to compare, so every synchronization run treats every entity as new.

The generated constructor parameter has no source. A natural key is a constructor parameter of the generated entity, taken from the named property. There is nothing to take it from.

How to fix it

Name a property declared on the same entity, spelled as in properties:.

id: card_number

If the key is genuinely composed of several values, it is not a natural key in this sense — model the entity with a framework-allocated address instead and let the content hash cover the rest.

If you disagree with a report

Do not suppress it. A wrong report is a bug in the check — report it with the YAML that triggered it.