Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cybermandiri.projectandroid.model;
- import androidx.annotation.NonNull;
- import androidx.room.ColumnInfo;
- import androidx.room.Entity;
- import androidx.room.Index;
- import androidx.room.PrimaryKey;
- @Entity(tableName = "kategori",
- indices = {
- @Index("id")
- }
- )
- public class Kategori {
- @PrimaryKey(autoGenerate = true)
- @NonNull
- @ColumnInfo(name = "id")
- private Integer id;
- @NonNull
- @ColumnInfo(name = "nama")
- private String nama;
- @NonNull
- public Integer getId() {
- return id;
- }
- public void setId(@NonNull Integer id) {
- this.id = id;
- }
- @NonNull
- public String getNama() {
- return nama;
- }
- public void setNama(@NonNull String nama) {
- this.nama = nama;
- }
- }
Add Comment
Please, Sign In to add comment