/**
 * "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 Asignatura {
    private int id_pk;
    private orm.Curso curso_id_fk;
    private orm.Profesor profesor_id_fk;
    private String nombre;
    private java.util.Set ORM_actividad = new java.util.HashSet();
    private java.util.Set ORM_nota = 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.ActividadSetCollection actividad = new orm.ActividadSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_ASIGNATURA_ACTIVIDAD, orm.ORMConstants.KEY_ACTIVIDAD_ASIGNATURA_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
    public final orm.NotaSetCollection nota = new orm.NotaSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_ASIGNATURA_NOTA, orm.ORMConstants.KEY_NOTA_ASIGNATURA_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);

    public Asignatura() {
    }

    private java.util.Set this_getSet(int key) {
        if (key == orm.ORMConstants.KEY_ASIGNATURA_ACTIVIDAD) {
            return ORM_actividad;
        } else if (key == orm.ORMConstants.KEY_ASIGNATURA_NOTA) {
            return ORM_nota;
        }

        return null;
    }

    private void this_setOwner(Object owner, int key) {
        if (key == orm.ORMConstants.KEY_ASIGNATURA_CURSO_ID_FK) {
            this.curso_id_fk = (orm.Curso) owner;
        } else if (key == orm.ORMConstants.KEY_ASIGNATURA_PROFESOR_ID_FK) {
            this.profesor_id_fk = (orm.Profesor) 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 String getNombre() {
        return nombre;
    }

    public void setNombre(String value) {
        this.nombre = value;
    }

    public orm.Curso getCurso_id_fk() {
        return curso_id_fk;
    }

    public void setCurso_id_fk(orm.Curso value) {
        if (curso_id_fk != null) {
            curso_id_fk.asignatura.remove(this);
        }
        if (value != null) {
            value.asignatura.add(this);
        }
    }

    private orm.Curso getORM_Curso_id_fk() {
        return curso_id_fk;
    }

    /**
     * This method is for internal use only.
     */
    public void setORM_Curso_id_fk(orm.Curso value) {
        this.curso_id_fk = value;
    }

    public orm.Profesor getProfesor_id_fk() {
        return profesor_id_fk;
    }

    public void setProfesor_id_fk(orm.Profesor value) {
        if (profesor_id_fk != null) {
            profesor_id_fk.asignatura.remove(this);
        }
        if (value != null) {
            value.asignatura.add(this);
        }
    }

    private orm.Profesor getORM_Profesor_id_fk() {
        return profesor_id_fk;
    }

    /**
     * This method is for internal use only.
     */
    public void setORM_Profesor_id_fk(orm.Profesor value) {
        this.profesor_id_fk = value;
    }

    private java.util.Set getORM_Actividad() {
        return ORM_actividad;
    }

    private void setORM_Actividad(java.util.Set value) {
        this.ORM_actividad = value;
    }

    private java.util.Set getORM_Nota() {
        return ORM_nota;
    }

    private void setORM_Nota(java.util.Set value) {
        this.ORM_nota = value;
    }

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

}
