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

package javaprimitiva;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

/**
 *
 * @author Adrian
 */
@Entity
public class Columna 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.F57E5F0D-A64F-A01B-336E-817030F466F6]
    // </editor-fold>
    @Transient
    private List <Integer> Numeros; //lista de 6 numeros enteros

    private int n1;
    private int n2;
    private int n3;
    private int n4;
    private int n5;
    private int n6;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,id=DCE.524745FB-7F55-7AA5-64DA-AA7CC59B16E0]
    // </editor-fold>
    public Columna () {
        Numeros = new ArrayList();
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.2511AC1E-2D29-5E67-9F79-5AEBD1023622]
    // </editor-fold>
    public List <Integer> getNumeros () {
        return Numeros;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,regenBody=yes,id=DCE.1B6372C6-8710-53EE-182F-B982FD657227]
    // </editor-fold>
    public void setNumeros (List <Integer> val) {
        this.Numeros = val;
    }

    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 Columna)) {
            return false;
        }
        Columna other = (Columna) 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.Columna[id=" + id + "]";
    }

    //****************************************
    //************* GUARDAR NUMEROS **********
    //****************************************

    public void guardarC(){
        setN1((int) Numeros.get(0));
        setN2((int) Numeros.get(1));
        setN3((int) Numeros.get(2));
        setN4((int) Numeros.get(3));
        setN5((int) Numeros.get(4));
        setN6((int) Numeros.get(5));
        //controladorBD cbd = new controladorBD();
        //cbd.add(this);
    }

    public void cargaC(){
        Numeros.add(getN1());
        Numeros.add(getN2());
        Numeros.add(getN3());
        Numeros.add(getN4());
        Numeros.add(getN5());
        Numeros.add(getN6());
    }

    /**
     * @return the n1
     */
    public //lista de 6 numeros enteros
    int getN1() {
        return n1;
    }

    /**
     * @param n1 the n1 to set
     */
    public void setN1(int n1) {
        this.n1 = n1;
    }

    /**
     * @return the n2
     */
    public int getN2() {
        return n2;
    }

    /**
     * @param n2 the n2 to set
     */
    public void setN2(int n2) {
        this.n2 = n2;
    }

    /**
     * @return the n3
     */
    public int getN3() {
        return n3;
    }

    /**
     * @param n3 the n3 to set
     */
    public void setN3(int n3) {
        this.n3 = n3;
    }

    /**
     * @return the n4
     */
    public int getN4() {
        return n4;
    }

    /**
     * @param n4 the n4 to set
     */
    public void setN4(int n4) {
        this.n4 = n4;
    }

    /**
     * @return the n5
     */
    public int getN5() {
        return n5;
    }

    /**
     * @param n5 the n5 to set
     */
    public void setN5(int n5) {
        this.n5 = n5;
    }

    /**
     * @return the n6
     */
    public int getN6() {
        return n6;
    }

    /**
     * @param n6 the n6 to set
     */
    public void setN6(int n6) {
        this.n6 = n6;
    }
}
