package com.siemens.nkg.ejb.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class CauAllUnitId implements Serializable {

  private static final long serialVersionUID = 4227379583366153511L;

  private int cauCnoPlcnodeid;
  private int cauUnitid;

  public CauAllUnitId() {
    
  }

  public CauAllUnitId(int cauCnoPlcnodeid, int cauUnitid) {
    this.cauCnoPlcnodeid = cauCnoPlcnodeid;
    this.cauUnitid = cauUnitid;
  }

  @Column(name = "CAU_CNO_PLCNODEID", nullable = false, precision = 6, scale = 0)
  public int getCauCnoPlcnodeid() {
    return this.cauCnoPlcnodeid;
  }

  public void setCauCnoPlcnodeid(int cauCnoPlcnodeid) {
    this.cauCnoPlcnodeid = cauCnoPlcnodeid;
  }

  @Column(name = "CAU_UNITID", nullable = false, precision = 6, scale = 0)
  public int getCauUnitid() {
    return this.cauUnitid;
  }

  public void setCauUnitid(int cauUnitid) {
    this.cauUnitid = cauUnitid;
  }

  public boolean equals(Object other) {
    if ((this == other))
      return true;
    if ((other == null))
      return false;
    if (!(other instanceof CauAllUnitId))
      return false;
    CauAllUnitId castOther = (CauAllUnitId) other;

    return (this.getCauCnoPlcnodeid() == castOther.getCauCnoPlcnodeid())
        && (this.getCauUnitid() == castOther.getCauUnitid());
  }

  public int hashCode() {
    int result = 17;

    result = 37 * result + this.getCauCnoPlcnodeid();
    result = 37 * result + this.getCauUnitid();
    return result;
  }

}
