Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zamahaka
Created December 17, 2017 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamahaka/23cc8f3f8528ff867b84ecde49ef8241 to your computer and use it in GitHub Desktop.
Save zamahaka/23cc8f3f8528ff867b84ecde49ef8241 to your computer and use it in GitHub Desktop.
Fixed User data. Use MutableList instead of List
@Entity(tableName = UserDao.TABLE_NAME)
data class User @JvmOverloads constructor(
@PrimaryKey @ColumnInfo(name = COLUMN_ID) var id: Long? = null,
@ColumnInfo(name = COLUMN_NAME) var name: String? = null,
@ColumnInfo(name = COLUMN_EMAIL) var email: String? = null,
@ColumnInfo(name = COLUMN_TYPES) var types: MutableList<UserType?>? = null
)
enum class UserType { GROWER, LAB, DISPENSARY, PATIENT, DOCTOR, SUPPLIER, TRANSPORTATION, GOVERNMENT }
object UserColumns {
const val COLUMN_ID = "id"
const val COLUMN_NAME = "name"
const val COLUMN_EMAIL = "email"
const val COLUMN_TYPES = "types"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment