WorkOrderMonitoring.java 5.82 KB
Newer Older
akbar fauzi's avatar
akbar fauzi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
package com.eksad.masterdata.domain;

import com.eksad.ddms.common.util.object.EntityObject;
import com.eksad.masterdata.common.listEnum.WoState;
import com.eksad.masterdata.common.listEnum.WoStatus;
import jakarta.persistence.*;

import javax.validation.constraints.NotNull;
import java.util.Objects;

@Entity
@Table(name = "TRX_WO_MONITORING")
public class WorkOrderMonitoring implements EntityObject<WorkOrderMonitoring> {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "trx_wo_monitoring_gen")
    @SequenceGenerator(name = "trx_wo_monitoring_gen", sequenceName = "trx_wo_monitoring_seq", allocationSize = 1)
    Long id;

    @Column(unique = true)
    @NotNull(message = "Work Order Monitoring ID cannot be null")
    String woMonitoringID;

    String woID;
    @Enumerated(EnumType.STRING)
    WoState woLastKnownState;
    @Enumerated(EnumType.STRING)
    WoStatus woLastKnownStatus;
    String noPolisi;
    Integer pitNumber;
    String unitCustomerID;
    String customerAtendeeID;
    String description;
    @Version
    Long version;
    @Column(name = "reqPayload", columnDefinition = "TEXT")
    String reqPayload;
    String reffNumber;

    @Embedded
    private CreationalSpecification woMonitoringCreational;

    public WorkOrderMonitoring() {
    }

    public WorkOrderMonitoring(Long id, String woMonitoringID, String woID, WoState woLastKnownState, WoStatus woLastKnownStatus, String noPolisi, Integer pitNumber, String unitCustomerID, String customerAtendeeID, String description, Long version, String reqPayload, String reffNumber) {
        this.id = id;
        this.woMonitoringID = woMonitoringID;
        this.woID = woID;
        this.woLastKnownState = woLastKnownState;
        this.woLastKnownStatus = woLastKnownStatus;
        this.noPolisi = noPolisi;
        this.pitNumber = pitNumber;
        this.unitCustomerID = unitCustomerID;
        this.customerAtendeeID = customerAtendeeID;
        this.description = description;
        this.version = version;
        this.reqPayload = reqPayload;
        this.reffNumber = reffNumber;
    }

    public Long getId() {
        return id;
    }

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

    public String getWoMonitoringID() {
        return woMonitoringID;
    }

    public void setWoMonitoringID(String woMonitoringID) {
        this.woMonitoringID = woMonitoringID;
    }

    public String getWoID() {
        return woID;
    }

    public void setWoID(String woID) {
        this.woID = woID;
    }

    public WoState getWoLastKnownState() {
        return woLastKnownState;
    }

    public void setWoLastKnownState(WoState woLastKnownState) {
        this.woLastKnownState = woLastKnownState;
    }

    public WoStatus getWoLastKnownStatus() {
        return woLastKnownStatus;
    }

    public void setWoLastKnownStatus(WoStatus woLastKnownStatus) {
        this.woLastKnownStatus = woLastKnownStatus;
    }

    public String getNoPolisi() {
        return noPolisi;
    }

    public void setNoPolisi(String noPolisi) {
        this.noPolisi = noPolisi;
    }

    public Integer getPitNumber() {
        return pitNumber;
    }

    public void setPitNumber(Integer pitNumber) {
        this.pitNumber = pitNumber;
    }

    public String getUnitCustomerID() {
        return unitCustomerID;
    }

    public void setUnitCustomerID(String unitCustomerID) {
        this.unitCustomerID = unitCustomerID;
    }

    public String getCustomerAtendeeID() {
        return customerAtendeeID;
    }

    public void setCustomerAtendeeID(String customerAtendeeID) {
        this.customerAtendeeID = customerAtendeeID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getVersion() {
        return version;
    }

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

    public CreationalSpecification getWoMonitoringCreational() {
        return woMonitoringCreational;
    }

    public void setWoMonitoringCreational(CreationalSpecification woMonitoringCreational) {
        this.woMonitoringCreational = woMonitoringCreational;
    }

    public String getReqPayload() {
        return reqPayload;
    }

    public void setReqPayload(String reqPayload) {
        this.reqPayload = reqPayload;
    }

    public String getReffNumber() {
        return reffNumber;
    }

    public void setReffNumber(String reffNumber) {
        this.reffNumber = reffNumber;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 89 * hash + Objects.hashCode(this.woMonitoringID);
        hash = 89 * hash + Objects.hashCode(this.version);
        hash = 89 * hash + Objects.hashCode(this.woID);
        hash = 89 * hash + Objects.hashCode(this.woLastKnownState);
        hash = 89 * hash + Objects.hashCode(this.woLastKnownStatus);
        hash = 89 * hash + Objects.hashCode(this.noPolisi);
        hash = 89 * hash + Objects.hashCode(this.pitNumber);
        hash = 89 * hash + Objects.hashCode(this.unitCustomerID);
        hash = 89 * hash + Objects.hashCode(this.customerAtendeeID);
        hash = 89 * hash + Objects.hashCode(this.description);
        hash = 89 * hash + Objects.hashCode(this.woMonitoringCreational);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final WorkOrderMonitoring other = (WorkOrderMonitoring) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public boolean sameIdentityAs(WorkOrderMonitoring other) {
        return this.equals(other);
    }
}