/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * <p>
 * This is an automatic generated file. It will be regenerated every time
 * you generate persistence class.
 * <p>
 * Modifying its content may cause the program not work, or your work may lost.
 * <p>
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */

/**
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */
package orm;

public class Nota {
    private int id_pk;
    private orm.Estudiante estudiante_id_fk;
    private orm.Asignatura asignatura_id_fk;
    org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
        public void setOwner(Object owner, int key) {
            this_setOwner(owner, key);
        }

    };
    private Double valor;

    public Nota() {
    }

    private void this_setOwner(Object owner, int key) {
        if (key == orm.ORMConstants.KEY_NOTA_ESTUDIANTE_ID_FK) {
            this.estudiante_id_fk = (orm.Estudiante) owner;
        } else if (key == orm.ORMConstants.KEY_NOTA_ASIGNATURA_ID_FK) {
            this.asignatura_id_fk = (orm.Asignatura) owner;
        }
    }

    public int getId_pk() {
        return id_pk;
    }

    private void setId_pk(int value) {
        this.id_pk = value;
    }

    public int getORMID() {
        return getId_pk();
    }

    public void setValor(double value) {
        setValor(new Double(value));
    }

    public Double getValor() {
        return valor;
    }

    public void setValor(Double value) {
        this.valor = value;
    }

    public orm.Estudiante getEstudiante_id_fk() {
        return estudiante_id_fk;
    }

    public void setEstudiante_id_fk(orm.Estudiante value) {
        if (estudiante_id_fk != null) {
            estudiante_id_fk.nota.remove(this);
        }
        if (value != null) {
            value.nota.add(this);
        }
    }

    private orm.Estudiante getORM_Estudiante_id_fk() {
        return estudiante_id_fk;
    }

    /**
     * This method is for internal use only.
     */
    public void setORM_Estudiante_id_fk(orm.Estudiante value) {
        this.estudiante_id_fk = value;
    }

    public orm.Asignatura getAsignatura_id_fk() {
        return asignatura_id_fk;
    }

    public void setAsignatura_id_fk(orm.Asignatura value) {
        if (asignatura_id_fk != null) {
            asignatura_id_fk.nota.remove(this);
        }
        if (value != null) {
            value.nota.add(this);
        }
    }

    private orm.Asignatura getORM_Asignatura_id_fk() {
        return asignatura_id_fk;
    }

    /**
     * This method is for internal use only.
     */
    public void setORM_Asignatura_id_fk(orm.Asignatura value) {
        this.asignatura_id_fk = value;
    }

    public String toString() {
        return String.valueOf(getId_pk());
    }

}
