Created
October 22, 2017 14:10
-
-
Save AkshayChordiya/5e2adcaa80d2c733dd1e23386aeb6fce to your computer and use it in GitHub Desktop.
User entity for relation - Room
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity(tableName = "users", , foreignKeys = arrayOf( | |
ForeignKey(entity = Address::class, parentColumns = arrayOf("id"), childColumns = arrayOf("address_id")) | |
) | |
data class User( | |
@PrimaryKey(autoGenerate = true) | |
var id: Int = 0, | |
var name: String = "", | |
@ColumnInfo(name = "address_id") | |
var address: Long? = null, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment