/*
 * 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 ClienteJuridico 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.1791D7B8-FB8E-1E19-9F07-E8900388EF82]
    // </editor-fold>
    private String NIF;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,id=DCE.770A4BF4-157B-9DF0-7C99-19EEF570E861]
    // </editor-fold>
    public ClienteJuridico () {
        NIF = "ND";
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.0B1241CB-DBAA-F09C-181A-B1A105B7167E]
    // </editor-fold>
    public String getNIF () {
        return NIF;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.606624BB-66E3-B32E-83E3-B07CF2F99AFE]
    // </editor-fold>
    public void setNIF (String val) {
        this.NIF = val;
    }

    @Override
    public String getDatos(){
        String aux = "";
        aux+= getNombre() +" || NIF "+ NIF +" || 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 ClienteJuridico)) {
            return false;
        }
        ClienteJuridico other = (ClienteJuridico) 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.ClienteJuridico[id=" + id + "]";
    }

}
