Function: Entity()
Entity(
options?):ClassDecorator
Defined in: src/decorators/Table.ts:51
Class decorator marking a TypeScript class as a database entity managed by DbContext.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | string | EntityOptions | Optional entity configuration or table name string. |
Returns
ClassDecorator
Usecase
Register a model class for ORM mapping, automated schema generation, and DbSet integration.
Example
@Entity({ tableName: 'orders' })
export class Order {
@PrimaryKey()
id!: number;
}