The constructor of the class being decorated. The class must extend DynaRecord
and declare readonly type as a string literal (e.g., declare readonly type: "Order").
The decorator does not return a value.
Usage example:
@Entity
class User extends MyTable {
declare readonly type: "User";
// User entity implementation
}
A class decorator for marking a class as an entity within the context of the ORM system. This decorator is essential for registering the class as a distinct entity in the ORM's metadata system, enabling the ORM to recognize and manage instances of this class as part of its data model. By designating classes as entities, it facilitates their integration into the ORM framework, allowing for operations such as querying, persisting, and managing relationships between entities.
IMPORTANT - All entity classes should extend a table class decorated by Table
Entities MUST declare their
typeproperty as a string literal matching the class name. This enables compile-time type safety for query filters and return types.