Advertisement
bctoffolo

Annotated Comentario class

May 10th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. /**
  2.  *
  3.  */
  4. package muitobafao.model;
  5.  
  6. import java.util.*;
  7. import javax.persistence.*;
  8.  
  9. /**
  10.  * @author Bruno Toffolo
  11.  *
  12.  */
  13. @Entity
  14. @Table(name = "COMENTARIO")
  15. public class Comentario {
  16.  
  17.     @Id
  18.     @GeneratedValue(strategy = GenerationType.AUTO)
  19.     @Column(name = "ID")
  20.     private int id;
  21.    
  22.     @Basic
  23.     @Column(name = "COMENTARIO")
  24.     private String comentario;
  25.    
  26.     @Temporal(TemporalType.TIMESTAMP)
  27.     @Column(name = "DATA")
  28.     private Calendar data;
  29.    
  30.     @ManyToOne
  31.     @JoinColumn(name = "EVENTO_ID")
  32.     private Evento eventoComentario;
  33.    
  34.     @ManyToOne
  35.     @JoinColumn(name = "USUARIO_ID")
  36.     private Usuario usuario;
  37.  
  38.     public Comentario() {
  39.     }
  40.  
  41.     public Comentario(Usuario u, Evento e, String c) {
  42.         usuario = u;
  43.         eventoComentario = e;
  44.         comentario = c;
  45.         data = Calendar.getInstance();
  46.     }
  47.  
  48.     public int getId() {
  49.         return id;
  50.     }
  51.  
  52.     public void setId(int id) {
  53.         this.id = id;
  54.     }
  55.  
  56.     public String getComentario() {
  57.         return comentario;
  58.     }
  59.  
  60.     public void setComentario(String comentario) {
  61.         this.comentario = comentario;
  62.     }
  63.  
  64.     public Calendar getData() {
  65.         return data;
  66.     }
  67.  
  68.     public void setData(Calendar data) {
  69.         this.data = data;
  70.     }
  71.  
  72.     public Evento getEvento() {
  73.         return eventoComentario;
  74.     }
  75.  
  76.     public void setEvento(Evento eventoComentario) {
  77.         this.eventoComentario = eventoComentario;
  78.     }
  79.  
  80.     public Usuario getUsuario() {
  81.         return usuario;
  82.     }
  83.  
  84.     public void setUsuario(Usuario usuario) {
  85.         this.usuario = usuario;
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement