1 package ecar.pojo;
2
3
4
5 import java.util.Date;
6
7 import javax.persistence.Column;
8 import javax.persistence.Entity;
9 import javax.persistence.FetchType;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.Id;
12 import javax.persistence.JoinColumn;
13 import javax.persistence.ManyToOne;
14 import javax.persistence.Table;
15 import javax.persistence.Temporal;
16 import javax.persistence.TemporalType;
17
18 import org.hibernate.annotations.GenericGenerator;
19
20
21
22
23 @Entity
24 @Table(name = "TB_EMAIL")
25 public class Email implements java.io.Serializable {
26
27 public static final String LIDO = "S";
28 public static final String NLIDO = "N";
29 public static final String MARCA_LIDO = "1";
30 public static final String MARCA_NLIDO = "0";
31
32 private Long codEmail;
33 private String sistema;
34 private Date dataHoraEnvio;
35 private String assunto;
36 private String destinatario;
37 private String destinatariocc;
38 private String destinatariobcc;
39 private String conteudo;
40 private String lido;
41 private UsuarioUsu usuarioUsu;
42
43 public Email() {
44 }
45
46 public Email(String sistema, Date dataHoraEnvio, String assunto, String destinatario, String destinatariocc, String destinatariobcc, String conteudo, String lido, UsuarioUsu usuarioUsu) {
47 this.sistema = sistema;
48 this.dataHoraEnvio = dataHoraEnvio;
49 this.assunto = assunto;
50 this.destinatario = destinatario;
51 this.destinatariocc = destinatariocc;
52 this.destinatariobcc = destinatariobcc;
53 this.conteudo = conteudo;
54 this.lido = lido;
55 this.usuarioUsu = usuarioUsu;
56 }
57
58 public Email(UsuarioUsu usuarioUsu) {
59
60 this.usuarioUsu = usuarioUsu;
61 }
62
63 @GenericGenerator(name = "generator", strategy = "increment")
64 @Id
65 @GeneratedValue(generator = "generator")
66 @Column(name = "COD_EMAIL", nullable = false)
67 public Long getCodEmail() {
68 return this.codEmail;
69 }
70
71 public void setCodEmail(Long codEmail) {
72 this.codEmail = codEmail;
73 }
74
75 @Column(name = "SISTEMA")
76 public String getSistema() {
77 return this.sistema;
78 }
79
80 public void setSistema(String sistema) {
81 this.sistema = sistema;
82 }
83
84 @Temporal(TemporalType.TIMESTAMP)
85 @Column(name = "DATA_HORA_ENVIO", length = 8)
86 public Date getDataHoraEnvio() {
87 return this.dataHoraEnvio;
88 }
89
90 public void setDataHoraEnvio(Date dataHoraEnvio) {
91 this.dataHoraEnvio = dataHoraEnvio;
92 }
93
94 @Column(name = "ASSUNTO")
95 public String getAssunto() {
96 return this.assunto;
97 }
98
99 public void setAssunto(String assunto) {
100 this.assunto = assunto;
101 }
102
103 @Column(name = "DESTINATARIO")
104 public String getDestinatario() {
105 return this.destinatario;
106 }
107
108 public void setDestinatario(String destinatario) {
109 this.destinatario = destinatario;
110 }
111
112 @Column(name = "DESTINATARIOCC")
113 public String getDestinatariocc() {
114 return this.destinatariocc;
115 }
116
117 public void setDestinatariocc(String destinatariocc) {
118 this.destinatariocc = destinatariocc;
119 }
120
121 @Column(name = "DESTINATARIOBCC")
122 public String getDestinatariobcc() {
123 return this.destinatariobcc;
124 }
125
126 public void setDestinatariobcc(String destinatariobcc) {
127 this.destinatariobcc = destinatariobcc;
128 }
129
130 @Column(name = "CONTEUDO", length = -1)
131 public String getConteudo() {
132 return this.conteudo;
133 }
134
135 public void setConteudo(String conteudo) {
136 this.conteudo = conteudo;
137 }
138
139 @Column(name = "LIDO", length = 1)
140 public String getLido() {
141 return this.lido;
142 }
143
144 public void setLido(String lido) {
145 this.lido = lido;
146 }
147
148 @ManyToOne(fetch = FetchType.LAZY)
149 @JoinColumn(name = "COD_USU")
150 public UsuarioUsu getUsuarioUsu() {
151 return this.usuarioUsu;
152 }
153
154 public void setUsuarioUsu(UsuarioUsu usuarioUsu) {
155 this.usuarioUsu = usuarioUsu;
156 }
157
158 }