package org.well.well.domain;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "bus_device")
public class Device implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2023118078562324658L;
	/**
	 * 主键onlineState
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private Long id;
	/**
	 * 设备编号
	 */
	@Column(name ="DEVCODE")
	private String devCode;
	/**
	 * 设备名称
	 */
	@Column(name ="DEVICE_NAME")
	private String deviceName;
	/**
	 * 在线状态
	 */
	@Column(name ="ONLINE_STATE")
	private String onlineState;
	/**
	 * 设备类型
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEVICE_TYPE", nullable = false)
	@NotFound(action= NotFoundAction.IGNORE)
	private DeviceType deviceType;
	/**
	 * 是否有效
	 */
	@Column(name ="VALID")
	private Boolean valid;
	/**
	 * 安装时间
	 */
	@Column(name ="INSTALL_DATE")
	private Date installDate;
	/**
	 * 最新状态时间
	 */
	@Column(name ="LOGTIME")
	private Date logtime;
	/**
	 * 设备型号（关联型号表）
	 */
	@Column(name ="VERSION")
	private Integer version;


	@Column(name ="JOB_GENERATION_TYPE")
	private String jobGenerationType;



	public Long getId() {
		return id;
	}

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

	public String getDevCode() {
		return devCode;
	}

	public void setDevCode(String devCode) {
		this.devCode = devCode;
	}

	public String getDeviceName() {
		return deviceName;
	}

	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}

	public String getOnlineState() {
		return onlineState;
	}

	public void setOnlineState(String onlineState) {
		this.onlineState = onlineState;
	}

	public DeviceType getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(DeviceType deviceType) {
		this.deviceType = deviceType;
	}

	public Boolean getValid() {
		return valid;
	}

	public void setValid(Boolean valid) {
		this.valid = valid;
	}

	public Date getInstallDate() {
		return installDate;
	}

	public void setInstallDate(Date installDate) {
		this.installDate = installDate;
	}

	public Date getLogtime() {
		return logtime;
	}

	public void setLogtime(Date logtime) {
		this.logtime = logtime;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getJobGenerationType() {
		return jobGenerationType;
	}

	public void setJobGenerationType(String jobGenerationType) {
		this.jobGenerationType = jobGenerationType;
	}
}
