# RenameTable

Artifact: [androidx.room:room-common](https://developer.android.com/jetpack/androidx/releases/room) [View Source](https://cs.android.com/search?q=file:androidx/room/RenameTable.+class:androidx.room.RenameTable) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/room#2.4.0)

*** ** * ** ***


```
@Repeatable
@Target(allowedTargets = [AnnotationTarget.CLASS])
@Retention(value = AnnotationRetention.BINARY)
@OptionalExpectation
public annotation RenameTable
```

<br />

*** ** * ** ***

Repeatable annotation declaring the renamed tables in the new version of an auto migration.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/room/AutoMigration` |   |

## Summary

| ### Nested types |
|---|
| `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-target/index.html(allowedTargets = [https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-l-a-s-s/index.html]) @https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-retention/index.html(value = https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-retention/-b-i-n-a-r-y/index.html) public annotation https://developer.android.com/reference/androidx/room/RenameTable.Entries` Container annotation for the repeatable annotation `https://developer.android.com/reference/androidx/room/RenameTable`. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/room/RenameTable#getFromTableName()()` Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#from()` version of the database. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/room/RenameTable#getToTableName()()` Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#to()` version of the database. |

## Public methods

### getFromTableName

```
public final @NonNull String getFromTableName()
```

Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#from()` version of the database.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | Name of the table to rename from. |

### getToTableName

```
public final @NonNull String getToTableName()
```

Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#to()` version of the database.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | Name of the table to rename to. |