Cannot access to BaseColumns provides _ID property in Kotlin

Viewed 1225

I am defining my Users SQLite database table, and to do so, I have created the following UserContract and UserEntry classes:

class UserContract private constructor(){

    class UserEntry private constructor(): BaseColumns {

        companion object {
            val TABLE_NAME = "users"
            val COLUMN_DISPLAY_NAME = "display_name"
            val COLUMN_EMAIL = "email"
            //...
        }
    }
}

The problem I am facing is that I cannot access _ID property provided by BaseColums implementation:

val columnDisplayName = UserContract.UserEntry.COLUMN_DISPLAY_NAME //It is OK
val columnId = UserContract.UserEntry._ID //Unresolved reference: _ID

The equivalent code in Java works fine, so, does anybody knows what would be the reason or where the mistake is?

1 Answers
Related