Nova versao do simulador e tratamento de erros das chamadas.
[simdecs2.git] / src / java / org / ufcspa / simdecs / entities / Usuario.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package org.ufcspa.simdecs.entities;
6
7 import java.io.Serializable;
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.GenerationType;
12 import javax.persistence.Id;
13 import javax.persistence.SequenceGenerator;
14 import org.hibernate.annotations.Table;
15
16 /**
17  *
18  * @author maroni
19  */
20 @Entity
21 @Table(appliesTo="Usuario")
22 public class Usuario implements Serializable {
23     private static final long serialVersionUID = 1L;
24
25     
26     @Id
27     @SequenceGenerator(name="seqUsuario", sequenceName="SQ_USUARIO")
28     @GeneratedValue(strategy = GenerationType.AUTO, generator="seqUsuario")
29     private Long id;
30
31     @Column(length=50, nullable=false)
32     private String nome;
33
34     @Column(length=30, nullable=false, unique=true)
35     private String login;
36     
37     @Column(length=50, nullable=false)
38     private String senha;
39
40     public Long getId() {
41         return id;
42     }
43
44     public void setId(Long id) {
45         this.id = id;
46     }
47
48     public String getLogin() {
49         return login;
50     }
51
52     public void setLogin(String login) {
53         this.login = login;
54     }
55
56     public String getNome() {
57         return nome;
58     }
59
60     public void setNome(String nome) {
61         this.nome = nome;
62     }
63
64     public String getSenha() {
65         return senha;
66     }
67
68     public void setSenha(String senha) {
69         this.senha = senha;
70     }
71     
72     @Override
73     public int hashCode() {
74         int hash = 0;
75         hash += (id != null ? id.hashCode() : 0);
76         return hash;
77     }
78
79     @Override
80     public boolean equals(Object object) {
81         if (!(object instanceof Usuario)) {
82             return false;
83         }
84         Usuario other = (Usuario) object;
85         if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
86             return false;
87         }
88         return true;
89     }
90
91     @Override
92     public String toString() {
93         return "org.ufcspa.simdecs.entities.Usuario[ id=" + id + " ]";
94     }
95     
96 }