nauk0a

Untitled

Jul 21st, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.57 KB | None | 0 0
  1. package com.nauka.room
  2.  
  3. import androidx.room.Embedded
  4. import androidx.room.Entity
  5. import androidx.room.ForeignKey
  6. import androidx.room.PrimaryKey
  7.  
  8. @Entity(tableName = "employee")
  9. data class Employee(
  10.     @PrimaryKey(autoGenerate = true)
  11.     var id: Int,
  12.     var name: String,
  13.     var age: Int,
  14.     var breed: String
  15.  
  16. ) {
  17.     override fun toString() = "$id - $name - $age - $breed"
  18. }
  19.  
  20. @Entity(tableName = "address")
  21. data class Address(
  22.     @PrimaryKey(autoGenerate = true)
  23.     var aid: Int,
  24.     var street: String,
  25.     var city: String,
  26.     var postcode: Int
  27. )
Add Comment
Please, Sign In to add comment