/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Phone implements java.io.Serializable { private static final long serialVersionUID = 1L; @Id private Integer id ; @Column(name="number") private String number; @Column(name="type") private Integer type; // @ManyToOne // private Customer customer; // required default constructor public Phone( ) {} public Phone(Integer id ,String number, Integer type) { this.id=id; this.number = number; this.type = type; } public Integer getId( ) { return id; } public void setId(Integer id) { this.id = id; } public String getNumber( ) { return number; } public void setNumber(String number) { this.number = number; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } // @Override // public String toString() { // return "Phone{" + "id=" + id + ", number=" + number + ", type=" + type + '}'; // @Override // public int hashCode() { // int hash = 3; // hash = 53 * hash + Objects.hashCode(this.id); // hash = 53 * hash + Objects.hashCode(this.number); // hash = 53 * hash + Objects.hashCode(this.type); // return hash; // } // // @Override // public boolean equals(Object obj) { // if (obj == null) { // return false; // } // if (getClass() != obj.getClass()) { // return false; // } // final Phone other = (Phone) obj; // if (!Objects.equals(this.id, other.id)) { // return false; // } // if (!Objects.equals(this.number, other.number)) { // return false; // } // if (!Objects.equals(this.type, other.type)) { // return false; // } // return true; // } @Override public String toString() { return number ; } }