> For the complete documentation index, see [llms.txt](https://aerocode.gitbook.io/tynamo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aerocode.gitbook.io/tynamo/define-entity/define-entity.md).

# Define entity

### Define entity

&#x20;Write the `@DynamoEntity` decorator on top of the class definition.

```typescript
@DynamoEntity()
class Cat {
    ...
}
```

### With table attribute

Also you can put table information into `@DynamoEntity`. This information is used to table transaction.

```typescript
@DynamoEntity({
    BillingMode: "PAY_PER_REQUEST",
    ProvisionedThroughput: {
        ReadCapacityUnits : 15, // default 5
        WriteCapacityUnits: 20  // default 5
    }
})
class Cat {
    ...
}

new Tynamo(...).createTable(Cat);
new Tynamo(...).deleteTable(Cat);
new Tynamo(...).describeTable(Cat);
```

The parameter details are as follows :

```typescript
export interface TableInformation {
    TableName?: TableName;
    LocalSecondaryIndexes?: LocalSecondaryIndexList;
    GlobalSecondaryIndexes?: GlobalSecondaryIndexList;
    BillingMode?: BillingMode;
    ProvisionedThroughput?: ProvisionedThroughput;
    StreamSpecification?: StreamSpecification;
    SSESpecification?: SSESpecification;
    Tags?: TagList;
}
```

{% hint style="info" %}
This design is derived from `AWS.CreateTable`.

Check [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#createTable-property) for more information.
{% endhint %}
