# Entities and the `id`

An entity is a kind of stored record with a lasting identity, like a table
with types. Each one is declared in its own file under its domain's
`entities/` folder. A domain is one business area of your app, here
`planning`.

`domains/planning/entities/project.jadpo`:

```jadpo
type ProjectName = Text {
    max_length: 80
}

/// A group of todos with a shared goal.
entity Project {
    id: Uuid  // version 7, generated on create
    name: ProjectName
}
```

`Text` and `Uuid` are built in. `Project` and `ProjectName` are yours, and a
type only this file uses lives in this file.

Every entity's identity is one field, `id`, based on `Uuid`. Jadpo
generates it as a version 7 UUID when the record is created, or as the
version its named type pins, and callers never supply it. Other code
refers to the field as `Project.id`.

There is no compound identity. A link between two entities is an entity
of its own, with its own `id` and a unique rule over the two references.

An entity value is a snapshot that never changes: reading one of its
fields never touches the database.
