Adicionado classificaĆ§Ć£o do log conforme exemplo
[simdecs.git] / src / java / org / ufcspa / simdecs / entidade / Log.java
... / ...
CommitLineData
1/*\r
2 * To change this template, choose Tools | Templates\r
3 * and open the template in the editor.\r
4 */\r
5package org.ufcspa.simdecs.entidade;\r
6\r
7import java.io.Serializable;\r
8import java.util.Date;\r
9import javax.persistence.*;\r
10import javax.validation.constraints.NotNull;\r
11import javax.validation.constraints.Size;\r
12import javax.xml.bind.annotation.XmlRootElement;\r
13\r
14/**\r
15 *\r
16 * @author pbarros\r
17 */\r
18@Entity\r
19@Table(name = "log")\r
20@XmlRootElement\r
21@NamedQueries({\r
22 @NamedQuery(name = "Log.findAll", query = "SELECT l FROM Log l"),\r
23 @NamedQuery(name = "Log.findByIdlog", query = "SELECT l FROM Log l WHERE l.idlog = :idlog"),\r
24 @NamedQuery(name = "Log.findByDescricaolog", query = "SELECT l FROM Log l WHERE l.descricaolog = :descricaolog"),\r
25 @NamedQuery(name = "Log.findByUsuid", query = "SELECT l FROM Log l WHERE l.usuid = :usuid"),\r
26 @NamedQuery(name = "Log.findByDatalog", query = "SELECT l FROM Log l WHERE l.datalog = :datalog"),\r
27 @NamedQuery(name = "Log.findByHoralog", query = "SELECT l FROM Log l WHERE l.horalog = :horalog")})\r
28public class Log implements Serializable {\r
29 private static final long serialVersionUID = 1L;\r
30 @Id\r
31 @SequenceGenerator(name="seqLog", sequenceName="SQLOG")\r
32 @GeneratedValue(strategy=GenerationType.AUTO, generator="seqLog")\r
33 @Basic(optional = false)\r
34 @NotNull\r
35 @Column(name = "idlog")\r
36 private Integer idlog;\r
37 @Basic(optional = false)\r
38 @NotNull\r
39 @Size(min = 1, max = 200)\r
40 \r
41 @Column (name = "idTipoLog")\r
42 private Long idTipoLog;\r
43 \r
44 @Column(name = "descricaolog")\r
45 private String descricaolog;\r
46 @Basic(optional = false)\r
47 @NotNull\r
48 @Column(name = "usuid")\r
49 private long usuid;\r
50 @Column(name = "datalog")\r
51 @Temporal(TemporalType.DATE)\r
52 private Date datalog;\r
53 @Column(name = "horalog")\r
54 @Temporal(TemporalType.TIME)\r
55 private Date horalog;\r
56\r
57 public Log() {\r
58 }\r
59\r
60 public Log(Integer idlog) {\r
61 this.idlog = idlog;\r
62 }\r
63\r
64 public Log(Integer idlog, String descricaolog, long usuid) {\r
65 this.idlog = idlog;\r
66 this.descricaolog = descricaolog;\r
67 this.usuid = usuid;\r
68 }\r
69\r
70 public Integer getIdlog() {\r
71 return idlog;\r
72 }\r
73\r
74 public void setIdlog(Integer idlog) {\r
75 this.idlog = idlog;\r
76 }\r
77\r
78 public String getDescricaolog() {\r
79 return descricaolog;\r
80 }\r
81\r
82 public void setDescricaolog(String descricaolog) {\r
83 this.descricaolog = descricaolog;\r
84 }\r
85 \r
86 public Long getIdTipolog() {\r
87 return idTipoLog;\r
88 }\r
89\r
90 public void setIdTipolog(Long idtipolog) {\r
91 this.idTipoLog = idtipolog;\r
92 }\r
93\r
94 public long getUsuid() {\r
95 return usuid;\r
96 }\r
97\r
98 public void setUsuid(long usuid) {\r
99 this.usuid = usuid;\r
100 }\r
101\r
102 public Date getDatalog() {\r
103 return datalog;\r
104 }\r
105\r
106 public void setDatalog(Date datalog) {\r
107 this.datalog = datalog;\r
108 }\r
109\r
110 public Date getHoralog() {\r
111 return horalog;\r
112 }\r
113\r
114 public void setHoralog(Date horalog) {\r
115 this.horalog = horalog;\r
116 }\r
117\r
118 @Override\r
119 public int hashCode() {\r
120 int hash = 0;\r
121 hash += (idlog != null ? idlog.hashCode() : 0);\r
122 return hash;\r
123 }\r
124\r
125 @Override\r
126 public boolean equals(Object object) {\r
127 // TODO: Warning - this method won't work in the case the id fields are not set\r
128 if (!(object instanceof Log)) {\r
129 return false;\r
130 }\r
131 Log other = (Log) object;\r
132 if ((this.idlog == null && other.idlog != null) || (this.idlog != null && !this.idlog.equals(other.idlog))) {\r
133 return false;\r
134 }\r
135 return true;\r
136 }\r
137\r
138 @Override\r
139 public String toString() {\r
140 return "org.ufcspa.simdecs.entidade.Log[ idlog=" + idlog + " ]";\r
141 }\r
142 \r
143}\r