package org.well.well.domain;

import javax.persistence.*;

@Entity
@Table(name = "base_sensor")
public class SensorType implements java.io.Serializable {
    private Long id;
    private String sensorcode;
    private String sensorname;
    private Boolean active = true;
    private String watch;
    private DeviceType deviceType;

    public SensorType() {
    }

    public SensorType(String sensorcode) {
        this.sensorcode = sensorcode;
    }


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    public Long getId() {
        return id;
    }

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

    @Column(name = "SENSORCODE")
    public String getSensorcode() {
        return this.sensorcode;
    }

    public void setSensorcode(String sensorcode) {
        this.sensorcode = sensorcode;
    }

    @Column(name = "SENSORNAME", nullable = false)
    public String getSensorname() {
        return this.sensorname;
    }

    public void setSensorname(String sensorname) {
        this.sensorname = sensorname;
    }

    @Column(name = "ACTIVE", precision = 1, scale = 0)
    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    @Column(name = "WATCH", nullable = false)
    public String getWatch() {
        return watch;
    }

    public void setWatch(String watch) {
        this.watch = watch;
    }

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "DEVICE_TYPE")
    public DeviceType getDeviceType() {
        return deviceType;
    }

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