/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javabbuva;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 *
 * @author Adrian
 */
@Entity
public class ClienteFisico extends Cliente implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

        // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,id=DCE.DB3E5CAA-A799-D137-FA31-FE707145BEDA]
    // </editor-fold>
    private String DNI;

    private String apellido1;

    private String apellido2;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,id=DCE.1C25E742-35BE-3E16-C5B5-2A692387843A]
    // </editor-fold>
    public ClienteFisico () {
        DNI = "ND";
        apellido1 = "ND";
        apellido2 = "ND";
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.352E02B2-05B4-D4A1-ED37-302C91EFB5EA]
    // </editor-fold>
    public String getDNI () {
        return DNI;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.17C6A203-C2AA-96B4-0C8E-30F3DF190824]
    // </editor-fold>
    public void setDNI (String val) {
        this.DNI = val;
    }

    /**
     * @return the apellido1
     */

    public String getApellido1() {
        return apellido1;
    }

    /**
     * @param apellido1 the apellido1 to set
     */
    public void setApellido1(String apellido1) {
        this.apellido1 = apellido1;
    }

    /**
     * @return the apellido2
     */
    public String getApellido2() {
        return apellido2;
    }

    /**
     * @param apellido2 the apellido2 to set
     */
    public void setApellido2(String apellido2) {
        this.apellido2 = apellido2;
    }

    @Override
    public String getDatos(){
        String aux = "";
        aux+= getNombre() +" "+ apellido1 +" "+ apellido2 +" || DNI: "+ DNI +" || Localidad: "+ getDireccion() +" || Telefono: "+ getTelefono();
        return aux;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.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 ClienteFisico)) {
            return false;
        }
        ClienteFisico other = (ClienteFisico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vistas.ClienteFisico[id=" + id + "]";
    }

}
