# RenameColumn

Artifact: [androidx.room:room-common](https://developer.android.com/jetpack/androidx/releases/room) [View Source](https://cs.android.com/search?q=file:androidx/room/RenameColumn.+class:androidx.room.RenameColumn) 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 RenameColumn
```

<br />

*** ** * ** ***

Repeatable annotation declaring the renamed columns in the `https://developer.android.com/reference/androidx/room/AutoMigration#to()` 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/RenameColumn.Entries` Container annotation for the repeatable annotation `https://developer.android.com/reference/androidx/room/RenameColumn`. |

| ### 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/RenameColumn#getFromColumnName()()` Name of the column 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/RenameColumn#getTableName()()` Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#from()` version of the database the renamed column is found in. |
| `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/RenameColumn#getToColumnName()()` Name of the column in the `https://developer.android.com/reference/androidx/room/AutoMigration#to()` version of the database. |

## Public methods

### getFromColumnName

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

Name of the column 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 column. |

### getTableName

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

Name of the table in the `https://developer.android.com/reference/androidx/room/AutoMigration#from()` version of the database the renamed column is found in. The name in `https://developer.android.com/reference/androidx/room/AutoMigration#from()` version is used in case the table was renamed in the `https://developer.android.com/reference/androidx/room/AutoMigration#to()` version.

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

### getToColumnName

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

Name of the column 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 column. |