/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

package db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the teaches database table.
 * 
 */
@Embeddable
public class TeachPK implements Serializable {
  // default serial version id, required for serializable classes.
  private static final long serialVersionUID = 1L;
  private Long course;
  private Long staff;

  public TeachPK() {
  }

  @Column(insertable = false, updatable = false, unique = true, nullable = false)
  public Long getCourse() {
    return this.course;
  }

  public void setCourse(Long course) {
    this.course = course;
  }

  @Column(insertable = false, updatable = false, unique = true, nullable = false)
  public Long getStaff() {
    return this.staff;
  }

  public void setStaff(Long staff) {
    this.staff = staff;
  }

  public boolean equals(Object other) {
    if (this == other) {
      return true;
    }
    if (!(other instanceof TeachPK)) {
      return false;
    }
    TeachPK castOther = (TeachPK) other;
    return this.course.equals(castOther.course) && this.staff.equals(castOther.staff);
  }

  public int hashCode() {
    final int prime = 31;
    int hash = 17;
    hash = hash * prime + this.course.hashCode();
    hash = hash * prime + this.staff.hashCode();

    return hash;
  }
}
