sttc 엔티티 수정
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.ZonedDateTime;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.OffsetDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
@@ -17,26 +17,29 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
@Table(name = "tb_map_sheet_anal_sttc")
|
||||
public class MapSheetAnalSttcEntity {
|
||||
|
||||
@EmbeddedId private MapSheetAnalSttcEntityId id;
|
||||
@EmbeddedId
|
||||
private MapSheetAnalSttcEntityId id;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "class_before_cnt")
|
||||
private Long classBeforeCnt;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "class_after_cnt")
|
||||
private Long classAfterCnt;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_dttm")
|
||||
private ZonedDateTime createdDttm;
|
||||
private OffsetDateTime createdDttm;
|
||||
|
||||
@Column(name = "created_uid")
|
||||
private Long createdUid;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "updated_dttm")
|
||||
private ZonedDateTime updatedDttm;
|
||||
private OffsetDateTime updatedDttm;
|
||||
|
||||
@Column(name = "updated_uid", length = Integer.MAX_VALUE)
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
|
||||
@NotNull
|
||||
@@ -47,26 +50,12 @@ public class MapSheetAnalSttcEntity {
|
||||
@Column(name = "data_uid", nullable = false)
|
||||
private Long dataUid;
|
||||
|
||||
@Column(name = "class_before_cd")
|
||||
@Size(max = 30)
|
||||
@Column(name = "class_before_cd", length = 30)
|
||||
private String classBeforeCd;
|
||||
|
||||
@Column(name = "class_after_cd")
|
||||
@Size(max = 30)
|
||||
@Column(name = "class_after_cd", length = 30)
|
||||
private String classAfterCd;
|
||||
|
||||
public InferenceResultDto.Dashboard toDto() {
|
||||
return new InferenceResultDto.Dashboard(
|
||||
id.getCompareYyyy(),
|
||||
id.getTargetYyyy(),
|
||||
id.getMapSheetNum(),
|
||||
id.getClassBeforeName(),
|
||||
id.getClassAfterName(),
|
||||
this.classBeforeCnt,
|
||||
this.classAfterCnt,
|
||||
this.createdDttm,
|
||||
this.createdUid,
|
||||
this.updatedDttm,
|
||||
this.updatedUid,
|
||||
this.refMapSheetNum,
|
||||
this.dataUid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.kamco.cd.kamcoback.postgres.entity;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
@@ -15,8 +14,7 @@ import org.hibernate.Hibernate;
|
||||
@Embeddable
|
||||
public class MapSheetAnalSttcEntityId implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8630519290255405042L;
|
||||
|
||||
private static final long serialVersionUID = 2285491656408229553L;
|
||||
@NotNull
|
||||
@Column(name = "compare_yyyy", nullable = false)
|
||||
private Integer compareYyyy;
|
||||
@@ -29,16 +27,6 @@ public class MapSheetAnalSttcEntityId implements Serializable {
|
||||
@Column(name = "map_sheet_num", nullable = false)
|
||||
private Long mapSheetNum;
|
||||
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
@Column(name = "class_before_name", nullable = false, length = 64)
|
||||
private String classBeforeName;
|
||||
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
@Column(name = "class_after_name", nullable = false, length = 64)
|
||||
private String classAfterName;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -48,15 +36,14 @@ public class MapSheetAnalSttcEntityId implements Serializable {
|
||||
return false;
|
||||
}
|
||||
MapSheetAnalSttcEntityId entity = (MapSheetAnalSttcEntityId) o;
|
||||
return Objects.equals(this.targetYyyy, entity.targetYyyy)
|
||||
&& Objects.equals(this.classBeforeName, entity.classBeforeName)
|
||||
&& Objects.equals(this.classAfterName, entity.classAfterName)
|
||||
&& Objects.equals(this.compareYyyy, entity.compareYyyy)
|
||||
&& Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
||||
return Objects.equals(this.targetYyyy, entity.targetYyyy) &&
|
||||
Objects.equals(this.compareYyyy, entity.compareYyyy) &&
|
||||
Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(targetYyyy, classBeforeName, classAfterName, compareYyyy, mapSheetNum);
|
||||
return Objects.hash(targetYyyy, compareYyyy, mapSheetNum);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user