Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. package disciplinas.entities;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import javax.persistence.Entity;
  6. import javax.persistence.GeneratedValue;
  7. import javax.persistence.Id;
  8.  
  9.  
  10. @Entity
  11. public class Disciplina {
  12.  
  13.     @Id
  14.     @GeneratedValue
  15.     private long id;
  16.     private String nome;
  17.     private double nota;
  18. //  private ArrayList<String> comments;
  19.     private int likes;
  20.    
  21.     public Disciplina() {
  22.         super();
  23.     }
  24.    
  25.     public Disciplina(long id, String nome, double nota, int likes) {
  26.         this.id = id;
  27.         this.nome = nome;
  28.         this.nota = nota;
  29. //      this.comments = comments;
  30.         this.likes = likes;
  31.     }
  32.    
  33. //  ----------------------------
  34.    
  35.     /*
  36.     public void postComment(String comment) {
  37.         this.comments.add(comment);
  38.     }
  39.     */
  40.    
  41.     public void likesSubject() {
  42.         this.likes++;
  43.     }
  44.    
  45. //  ----------------------------
  46.  
  47.     public String getNome() {
  48.         return nome;
  49.     }
  50.  
  51.     public void setNome(String nome) {
  52.         this.nome = nome;
  53.     }
  54.  
  55.     public double getNota() {
  56.         return nota;
  57.     }
  58.  
  59.     public void setNota(double nota) {
  60.         this.nota = nota;
  61.     }
  62.  
  63.     public int getLikes() {
  64.         return likes;
  65.     }
  66.  
  67.     public void setLikes(int likes) {
  68.         this.likes = likes;
  69.     }
  70.  
  71.     public long getId() {
  72.         return id;
  73.     }
  74.    
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement