@Entity
@Table(name = "utente")
@NamedQueries({@NamedQuery(name = "Utente.findAll", query = "SELECT u FROM Utente u"), @NamedQuery(name = "Utente.findByIdutente", query = "SELECT u FROM Utente u WHERE u.idutente = :idutente"), @NamedQuery(name = "Utente.findByNome", query = "SELECT u FROM Utente u WHERE u.nome = :nome"), @NamedQuery(name = "Utente.findByCognome", query = "SELECT u FROM Utente u WHERE u.cognome = :cognome")})
public class Utente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idutente")
private Integer idutente;
@Basic(optional = false)
@Column(name = "nome")
private String nome;
@Basic(optional = false)
@Column(name = "cognome")
private String cognome;
@JoinColumn(name = "idutente", referencedColumnName = "idstoria", insertable = false, updatable = false)
@OneToOne(optional = false)
private Storiautente storiautente;
public Utente() {
}
public Utente(Integer idutente) {
this.idutente = idutente;
}
public Utente(Integer idutente, String nome, String cognome) {
this.idutente = idutente;
this.nome = nome;
this.cognome = cognome;
}
public Integer getIdutente() {
return idutente;
}
public void setIdutente(Integer idutente) {
this.idutente = idutente;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCognome() {
return cognome;
}
public void setCognome(String cognome) {
this.cognome = cognome;
}
public Storiautente getStoriautente() {
return storiautente;
}
public void setStoriautente(Storiautente storiautente) {
this.storiautente = storiautente;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idutente != null ? idutente.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Utente)) {
return false;
}
Utente other = (Utente) object;
if ((this.idutente == null && other.idutente != null) || (this.idutente != null && !this.idutente.equals(other.idutente))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.ute.Utente[idutente=" + idutente + "]";
}
}