Advertisement
Guest User

Siswa.java

a guest
Dec 11th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. package com.amel.your_student.Model;
  2.  
  3.  
  4. import androidx.annotation.NonNull;
  5. import androidx.room.ColumnInfo;
  6. import androidx.room.Entity;
  7. import androidx.room.Index;
  8. import androidx.room.PrimaryKey;
  9.  
  10.  
  11. @Entity(tableName = "siswa",
  12.         indices = {
  13.                 @Index("id")
  14.         }
  15. )
  16.  
  17. public class Siswa {
  18.     @PrimaryKey(autoGenerate = true)
  19.     @NonNull
  20.     @ColumnInfo(name = "id")
  21.     private Integer id;
  22.  
  23.     @NonNull
  24.     @ColumnInfo(name = "nim")
  25.     private String nim;
  26.  
  27.     @NonNull
  28.     @ColumnInfo(name = "nama")
  29.     private String nama;
  30.  
  31.  
  32.     @NonNull
  33.     public Integer getId() {
  34.         return id;
  35.     }
  36.  
  37.     public void setId(@NonNull Integer id) {
  38.         this.id = id;
  39.     }
  40.  
  41.     @NonNull
  42.     public String getNim() {
  43.         return nim;
  44.     }
  45.  
  46.     public void setNim(@NonNull String nim) {
  47.         this.nim = nim;
  48.     }
  49.  
  50.     @NonNull
  51.     public String getNama() {
  52.         return nama;
  53.     }
  54.  
  55.     public void setNama(@NonNull String nama) {
  56.         this.nama = nama;
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement