# RoomWarnings

Summary:[Constants](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#constants)\|[Ctors](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#pubctors)\|[Inherited Methods](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#inhmethods)  

# RoomWarnings

| The`android.arch`Architecture Components packages are no longer maintained. They have been superseded by the corresponding[androidx.\*](https://developer.android.com/jetpack/androidx/migrate)packages. See[androidx.room.RoomWarnings](https://developer.android.com/reference/androidx/room/RoomWarnings)instead.

`
public


class
RoomWarnings
`  
`

extends Object


``


`

|---|--------------------------------------------|
| java.lang.Object                              ||
| ↳ | android.arch.persistence.room.RoomWarnings |

<br />

*** ** * ** ***

The list of warnings that are produced by Room.

You can use these values inside a[SuppressWarnings](https://developer.android.com/reference/java/lang/SuppressWarnings)annotation to disable the warnings.

## Summary

|                                                                                                                                                                                                                                                                                                                                             ### Constants                                                                                                                                                                                                                                                                                                                                             ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | [CANNOT_CREATE_VERIFICATION_DATABASE](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#CANNOT_CREATE_VERIFICATION_DATABASE) Reported when Room cannot verify database queries during compilation.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `String` | [CURSOR_MISMATCH](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#CURSOR_MISMATCH) The warning dispatched by Room when the return value of a[Query](https://developer.android.com/reference/android/arch/persistence/room/Query)method does not exactly match the fields in the query result.                                                                                                                                                                                                                                                                                                                                                            |
| `String` | [DEFAULT_CONSTRUCTOR](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#DEFAULT_CONSTRUCTOR) Reported when a Pojo has multiple constructors, one of which is a no-arg constructor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `String` | [INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED) Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)that has a[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)d field whose type is another[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)and that[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)has some indices defined.                                                                      |
| `String` | [INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED) Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)field that is annotated with[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)has a sub field which has a[ColumnInfo](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo)annotation with`index = true`.                                                                                                                                         |
| `String` | [INDEX_FROM_PARENT_FIELD_IS_DROPPED](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#INDEX_FROM_PARENT_FIELD_IS_DROPPED) Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)inherits a field from its super class and the field has a[ColumnInfo](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo)annotation with`index = true`.                                                                                                                                                                                                                                     |
| `String` | [INDEX_FROM_PARENT_IS_DROPPED](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#INDEX_FROM_PARENT_IS_DROPPED) Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)'s parent declares an[Index](https://developer.android.com/reference/android/arch/persistence/room).                                                                                                                                                                                                                                                                                                                                  |
| `String` | [MISSING_INDEX_ON_FOREIGN_KEY_CHILD](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#MISSING_INDEX_ON_FOREIGN_KEY_CHILD) When there is a foreign key from Entity A to Entity B, it is a good idea to index the reference columns in B, otherwise, each modification on Entity A will trigger a full table scan on Entity B.                                                                                                                                                                                                                                                                                                                              |
| `String` | [MISSING_JAVA_TMP_DIR](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#MISSING_JAVA_TMP_DIR) Reported when Room cannot verify database queries during compilation due to lack of tmp dir access in JVM.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `String` | [MISSING_SCHEMA_LOCATION](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#MISSING_SCHEMA_LOCATION) Reported when a \`room.schemaLocation\` argument is not provided into the annotation processor.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `String` | [PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED) Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)field that is annotated with[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)has a sub field which is annotated with[PrimaryKey](https://developer.android.com/reference/android/arch/persistence/room/PrimaryKey)but the[PrimaryKey](https://developer.android.com/reference/android/arch/persistence/room/PrimaryKey)is dropped while composing it into the parent object. |
| `String` | [RELATION_QUERY_WITHOUT_TRANSACTION](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#RELATION_QUERY_WITHOUT_TRANSACTION) Reported when a @Query method returns a Pojo that has relations but the method is not annotated with @Transaction.                                                                                                                                                                                                                                                                                                                                                                                                              |
| `String` | [RELATION_TYPE_MISMATCH](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#RELATION_TYPE_MISMATCH) Reported when a[Relation](https://developer.android.com/reference/android/arch/persistence/room/Relation)[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)'s SQLite column type does not match the type in the parent.                                                                                                                                                                                                                                                                                             |

|                                                   ### Public constructors                                                    ||
|---------------------------------------------------------------------------------------------------------------------------|---|
| ` `[RoomWarnings](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings#RoomWarnings())`() ` |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### CANNOT_CREATE_VERIFICATION_DATABASE

```
String CANNOT_CREATE_VERIFICATION_DATABASE
```

Reported when Room cannot verify database queries during compilation. This usually happens when it cannot find the SQLite JDBC driver on the host machine.

Room can function without query verification but its functionality will be limited.

<br />

Constant Value: "ROOM_CANNOT_CREATE_VERIFICATION_DATABASE"  

### CURSOR_MISMATCH

```
String CURSOR_MISMATCH
```

The warning dispatched by Room when the return value of a[Query](https://developer.android.com/reference/android/arch/persistence/room/Query)method does not exactly match the fields in the query result.

<br />

Constant Value: "ROOM_CURSOR_MISMATCH"  

### DEFAULT_CONSTRUCTOR

```
String DEFAULT_CONSTRUCTOR
```

Reported when a Pojo has multiple constructors, one of which is a no-arg constructor. Room will pick that one by default but will print this warning in case the constructor choice is important. You can always guide Room to use the right constructor using the @Ignore annotation.

<br />

Constant Value: "ROOM_DEFAULT_CONSTRUCTOR"  

### INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED

```
String INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED
```

Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)that has a[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)d field whose type is another[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)and that[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)has some indices defined. These indices will NOT be created in the containing[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity). If you want to preserve them, you can re-define them in the containing[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity).

<br />

Constant Value: "ROOM_EMBEDDED_ENTITY_INDEX_IS_DROPPED"  

### INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED

```
String INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED
```

Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)field that is annotated with[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)has a sub field which has a[ColumnInfo](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo)annotation with`index = true`.

You can re-define the index in the containing[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity).

<br />

Constant Value: "ROOM_EMBEDDED_INDEX_IS_DROPPED"  

### INDEX_FROM_PARENT_FIELD_IS_DROPPED

```
String INDEX_FROM_PARENT_FIELD_IS_DROPPED
```

Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)inherits a field from its super class and the field has a[ColumnInfo](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo)annotation with`index = true`.

These indices are dropped for the[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)and you would need to re-declare them if you want to keep them. Alternatively, you can set[inheritSuperIndices()](https://developer.android.com/reference/android/arch/persistence/room/Entity#inheritSuperIndices())to`true`.

<br />

Constant Value: "ROOM_PARENT_FIELD_INDEX_IS_DROPPED"  

### INDEX_FROM_PARENT_IS_DROPPED

```
String INDEX_FROM_PARENT_IS_DROPPED
```

Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)'s parent declares an[Index](https://developer.android.com/reference/android/arch/persistence/room). Room does not automatically inherit these indices to avoid hidden costs or unexpected constraints.

If you want your child class to have the indices of the parent, you must re-declare them in the child class. Alternatively, you can set[inheritSuperIndices()](https://developer.android.com/reference/android/arch/persistence/room/Entity#inheritSuperIndices())to`true`.

<br />

Constant Value: "ROOM_PARENT_INDEX_IS_DROPPED"  

### MISSING_INDEX_ON_FOREIGN_KEY_CHILD

```
String MISSING_INDEX_ON_FOREIGN_KEY_CHILD
```

When there is a foreign key from Entity A to Entity B, it is a good idea to index the reference columns in B, otherwise, each modification on Entity A will trigger a full table scan on Entity B.

If Room cannot find a proper index in the child entity (Entity B in this case), Room will print this warning.

<br />

Constant Value: "ROOM_MISSING_FOREIGN_KEY_CHILD_INDEX"  

### MISSING_JAVA_TMP_DIR

```
String MISSING_JAVA_TMP_DIR
```

Reported when Room cannot verify database queries during compilation due to lack of tmp dir access in JVM.

<br />

Constant Value: "ROOM_MISSING_JAVA_TMP_DIR"  

### MISSING_SCHEMA_LOCATION

```
String MISSING_SCHEMA_LOCATION
```

Reported when a \`room.schemaLocation\` argument is not provided into the annotation processor. You can either set[exportSchema()](https://developer.android.com/reference/android/arch/persistence/room/Database#exportSchema())to`false`or provide \`room.schemaLocation\` to the annotation processor. You are strongly adviced to provide it and also commit them into your version control system.

<br />

Constant Value: "ROOM_MISSING_SCHEMA_LOCATION"  

### PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED

```
String PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED
```

Reported when an[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)field that is annotated with[Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)has a sub field which is annotated with[PrimaryKey](https://developer.android.com/reference/android/arch/persistence/room/PrimaryKey)but the[PrimaryKey](https://developer.android.com/reference/android/arch/persistence/room/PrimaryKey)is dropped while composing it into the parent object.

<br />

Constant Value: "ROOM_EMBEDDED_PRIMARY_KEY_IS_DROPPED"  

### RELATION_QUERY_WITHOUT_TRANSACTION

```
String RELATION_QUERY_WITHOUT_TRANSACTION
```

Reported when a @Query method returns a Pojo that has relations but the method is not annotated with @Transaction. Relations are run as separate queries and if the query is not run inside a transaction, it might return inconsistent results from the database.

<br />

Constant Value: "ROOM_RELATION_QUERY_WITHOUT_TRANSACTION"  

### RELATION_TYPE_MISMATCH

```
String RELATION_TYPE_MISMATCH
```

Reported when a[Relation](https://developer.android.com/reference/android/arch/persistence/room/Relation)[Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)'s SQLite column type does not match the type in the parent. Room will still do the matching using`String`representations.

<br />

Constant Value: "ROOM_RELATION_TYPE_MISMATCH"

## Public constructors

### RoomWarnings

```
RoomWarnings ()
```

<br />

<br />

-

  ## Annotations

  - [ColumnInfo](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo)
  - [ColumnInfo.Collate](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo.Collate)
  - [ColumnInfo.SQLiteTypeAffinity](https://developer.android.com/reference/android/arch/persistence/room/ColumnInfo.SQLiteTypeAffinity)
  - [Dao](https://developer.android.com/reference/android/arch/persistence/room/Dao)
  - [Database](https://developer.android.com/reference/android/arch/persistence/room/Database)
  - [Delete](https://developer.android.com/reference/android/arch/persistence/room/Delete)
  - [Embedded](https://developer.android.com/reference/android/arch/persistence/room/Embedded)
  - [Entity](https://developer.android.com/reference/android/arch/persistence/room/Entity)
  - [ForeignKey](https://developer.android.com/reference/android/arch/persistence/room/ForeignKey)
  - [ForeignKey.Action](https://developer.android.com/reference/android/arch/persistence/room/ForeignKey.Action)
  - [Ignore](https://developer.android.com/reference/android/arch/persistence/room/Ignore)
  - [Index](https://developer.android.com/reference/android/arch/persistence/room)
  - [Insert](https://developer.android.com/reference/android/arch/persistence/room/Insert)
  - [OnConflictStrategy](https://developer.android.com/reference/android/arch/persistence/room/OnConflictStrategy)
  - [PrimaryKey](https://developer.android.com/reference/android/arch/persistence/room/PrimaryKey)
  - [Query](https://developer.android.com/reference/android/arch/persistence/room/Query)
  - [RawQuery](https://developer.android.com/reference/android/arch/persistence/room/RawQuery)
  - [Relation](https://developer.android.com/reference/android/arch/persistence/room/Relation)
  - [SkipQueryVerification](https://developer.android.com/reference/android/arch/persistence/room/SkipQueryVerification)
  - [Transaction](https://developer.android.com/reference/android/arch/persistence/room/Transaction)
  - [TypeConverter](https://developer.android.com/reference/android/arch/persistence/room/TypeConverter)
  - [TypeConverters](https://developer.android.com/reference/android/arch/persistence/room/TypeConverters)
  - [Update](https://developer.android.com/reference/android/arch/persistence/room/Update)
-

  ## Classes

  - [DatabaseConfiguration](https://developer.android.com/reference/android/arch/persistence/room/DatabaseConfiguration)
  - [InvalidationTracker](https://developer.android.com/reference/android/arch/persistence/room/InvalidationTracker)
  - [InvalidationTracker.Observer](https://developer.android.com/reference/android/arch/persistence/room/InvalidationTracker.Observer)
  - [Room](https://developer.android.com/reference/android/arch/persistence/room/Room)
  - [RoomDatabase](https://developer.android.com/reference/android/arch/persistence/room/RoomDatabase)
  - [RoomDatabase.Builder](https://developer.android.com/reference/android/arch/persistence/room/RoomDatabase.Builder)
  - [RoomDatabase.Callback](https://developer.android.com/reference/android/arch/persistence/room/RoomDatabase.Callback)
  - [RoomDatabase.MigrationContainer](https://developer.android.com/reference/android/arch/persistence/room/RoomDatabase.MigrationContainer)
  - [RoomWarnings](https://developer.android.com/reference/android/arch/persistence/room/RoomWarnings)
  - [RxRoom](https://developer.android.com/reference/android/arch/persistence/room/RxRoom)
-

  ## Enums

  - [RoomDatabase.JournalMode](https://developer.android.com/reference/android/arch/persistence/room/RoomDatabase.JournalMode)
-

  ## Exceptions

  - [EmptyResultSetException](https://developer.android.com/reference/android/arch/persistence/room/EmptyResultSetException)