package com.siemens.nkg.ejb.domain;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@Table(name = "CAU_ALL_UNIT", schema = "MCS", uniqueConstraints = @UniqueConstraint(columnNames = "CAU_UNITNAME"))
@NamedQueries(value = { @NamedQuery(name = "findAllUnits", query = "FROM CauAllUnit") })
public class CauAllUnit implements Serializable {

  private static final long serialVersionUID = 2081131297655884398L;

  private CauAllUnitId id;
  private String cauUnitname;
  private int cauCatTypeid;

  public CauAllUnit() {
    
  }

  public CauAllUnit(CauAllUnitId id, String cauUnitname, int cauCatTypeid) {
    this.id = id;
    this.cauUnitname = cauUnitname;
    this.cauCatTypeid = cauCatTypeid;
  }

  @EmbeddedId
  @AttributeOverrides({
      @AttributeOverride(name = "cauCnoPlcnodeid", column = @Column(name = "CAU_CNO_PLCNODEID", nullable = false, precision = 6, scale = 0)),
      @AttributeOverride(name = "cauUnitid", column = @Column(name = "CAU_UNITID", nullable = false, precision = 6, scale = 0)) })
  public CauAllUnitId getId() {
    return this.id;
  }

  public void setId(CauAllUnitId id) {
    this.id = id;
  }

  @Column(name = "CAU_UNITNAME", unique = true, nullable = false, length = 40)
  public String getCauUnitname() {
    return this.cauUnitname;
  }

  public void setCauUnitname(String cauUnitname) {
    this.cauUnitname = cauUnitname;
  }

  @Column(name = "CAU_CAT_TYPEID", nullable = false, precision = 6, scale = 0)
  public int getCauCatTypeid() {
    return this.cauCatTypeid;
  }

  public void setCauCatTypeid(int cauCatTypeid) {
    this.cauCatTypeid = cauCatTypeid;
  }

}
