/**
 * "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
 * <p>
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */

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

public class Profesor {
    private int id_pk;
    private orm.Colegio colegio_id_fk;
    private String nombre;
    private String rut;
    private java.util.Set ORM_asignatura = new java.util.HashSet();
    private java.util.Set ORM_anotacion = 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_PROFESOR_ASIGNATURA, orm.ORMConstants.KEY_ASIGNATURA_PROFESOR_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
    public final orm.AnotacionSetCollection anotacion = new orm.AnotacionSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_PROFESOR_ANOTACION, orm.ORMConstants.KEY_ANOTACION_PROFESOR_ID_FK, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);

    public Profesor() {
    }

    private java.util.Set this_getSet(int key) {
        if (key == orm.ORMConstants.KEY_PROFESOR_ASIGNATURA) {
            return ORM_asignatura;
        } else if (key == orm.ORMConstants.KEY_PROFESOR_ANOTACION) {
            return ORM_anotacion;
        }

        return null;
    }

    private void this_setOwner(Object owner, int key) {
        if (key == orm.ORMConstants.KEY_PROFESOR_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 String getNombre() {
        return nombre;
    }

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

    public String getRut() {
        return rut;
    }

    public void setRut(String value) {
        this.rut = 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.profesor.remove(this);
        }
        if (value != null) {
            value.profesor.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_Anotacion() {
        return ORM_anotacion;
    }

    private void setORM_Anotacion(java.util.Set value) {
        this.ORM_anotacion = value;
    }

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

}
