Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.nauka.room
- import androidx.room.Embedded
- import androidx.room.Entity
- import androidx.room.ForeignKey
- import androidx.room.PrimaryKey
- @Entity(tableName = "employee")
- data class Employee(
- @PrimaryKey(autoGenerate = true)
- var id: Int,
- var name: String,
- var age: Int,
- var breed: String
- ) {
- override fun toString() = "$id - $name - $age - $breed"
- }
- @Entity(tableName = "address")
- data class Address(
- @PrimaryKey(autoGenerate = true)
- var aid: Int,
- var street: String,
- var city: String,
- var postcode: Int
- )
Add Comment
Please, Sign In to add comment