/**
 * "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 Curso {
    private int id_pk;
    private orm.Colegio colegio_id_fk;
    private Integer nivel;
    private String letra;
    private java.util.Set ORM_asignatura = new java.util.HashSet();
    private java.util.Set ORM_estudiante = new java.util.HashSet();
    org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
        public java.util.Set getSet(int key) {
            return this_getSet(key);
        }

        public void setOwner(Object owner, int key) {
            this_setOwner(owner, key);
        }

    };
    public final orm.AsignaturaSetCollection asignatura = new orm.AsignaturaSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_CURSO_ASIGNATURA, orm.ORMConstants.KEY_ASIGNATURA_CURSO_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
    public final orm.EstudianteSetCollection estudiante = new orm.EstudianteSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_CURSO_ESTUDIANTE, orm.ORMConstants.KEY_ESTUDIANTE_CURSO_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);

    public Curso() {
    }

    private java.util.Set this_getSet(int key) {
        if (key == orm.ORMConstants.KEY_CURSO_ASIGNATURA) {
            return ORM_asignatura;
        } else if (key == orm.ORMConstants.KEY_CURSO_ESTUDIANTE) {
            return ORM_estudiante;
        }

        return null;
    }

    private void this_setOwner(Object owner, int key) {
        if (key == orm.ORMConstants.KEY_CURSO_COLEGIO_ID_FK) {
            this.colegio_id_fk = (orm.Colegio) 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 setNivel(int value) {
        setNivel(new Integer(value));
    }

    public Integer getNivel() {
        return nivel;
    }

    public void setNivel(Integer value) {
        this.nivel = value;
    }

    public String getLetra() {
        return letra;
    }

    public void setLetra(String value) {
        this.letra = value;
    }

    public orm.Colegio getColegio_id_fk() {
        return colegio_id_fk;
    }

    public void setColegio_id_fk(orm.Colegio value) {
        if (colegio_id_fk != null) {
            colegio_id_fk.curso.remove(this);
        }
        if (value != null) {
            value.curso.add(this);
        }
    }

    private orm.Colegio getORM_Colegio_id_fk() {
        return colegio_id_fk;
    }

    /**
     * This method is for internal use only.
     */
    public void setORM_Colegio_id_fk(orm.Colegio value) {
        this.colegio_id_fk = value;
    }

    private java.util.Set getORM_Asignatura() {
        return ORM_asignatura;
    }

    private void setORM_Asignatura(java.util.Set value) {
        this.ORM_asignatura = value;
    }

    private java.util.Set getORM_Estudiante() {
        return ORM_estudiante;
    }

    private void setORM_Estudiante(java.util.Set value) {
        this.ORM_estudiante = value;
    }

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

}
