fix: jpa 로그 출력 설정 추가

수동 ID를 갖는 엔티티 -> Persistable 구현
dev
Lim Jonguk 3 years ago
parent a60c416f95
commit 2bfc67d5e3

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*;
import java.io.Serializable;
@ -17,8 +18,7 @@ import java.io.Serializable;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Builder
public class MinCivBoard680 implements Serializable {
private static final long SerialVersionUID = 1L;
public class MinCivBoard680 implements Persistable<Long> {
@Id
@Schema(required = true, title = "게시판코드", example = " ", description = "Input Description...")
@ -85,5 +85,13 @@ public class MinCivBoard680 implements Serializable {
@Column(name = "ci_ip", nullable = true)
private String ciIp;
@Override
public Long getId() {
return this.ciCode;
}
@Override
public boolean isNew() {
return this.ciCode == 0L && this.ciNalja == null;
}
}

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*;
import java.time.LocalDate;
@ -17,15 +18,13 @@ import java.time.LocalDate;
@AllArgsConstructor
@Getter
@Builder
public class MinSimsa680 { //implements Serializable {
//private static final long SerialVersionUID = 1L;
public class MinSimsa680 implements Persistable<Long> {
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@Id
@Column(name = "ms_maincode")
private Long msMaincode;
@Schema(required = true, title = "접수번호", example = " ", description = "Input Description...")
@Column(name = "ms_seq", nullable = false)
private String msSeq;
@ -78,4 +77,13 @@ public class MinSimsa680 { //implements Serializable {
@Column(name = "ms_jbtime", nullable = true)
private String msJbtime;
@Override
public Long getId() {
return this.msMaincode;
}
@Override
public boolean isNew() {
return this.msMaincode == 0L;
}
}

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -20,15 +21,13 @@ import java.time.LocalDate;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Builder
public class MinSimsa680Sc { //implements Serializable {
//private static final long SerialVersionUID = 1L;
public class MinSimsa680Sc implements Persistable<Long> {
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@Id
@Column(name = "ms_maincode")
private Long msMaincode;
@Schema(required = true, title = "접수번호", example = " ", description = "Input Description...")
@Column(name = "ms_seq", nullable = false)
private String msSeq;
@ -84,4 +83,14 @@ public class MinSimsa680Sc { //implements Serializable {
@Schema(required = false, title = "데이타구분", example = "1", description = "데이타구분: 1-거주자, 2-장애인")
@Column(name = "ms_datagb", nullable = false)
private String msDatagb;
@Override
public Long getId() {
return this.msMaincode;
}
@Override
public boolean isNew() {
return this.msMaincode == 0L;
}
}

@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*;
import java.io.Serializable;
@ -21,8 +22,7 @@ import java.util.Set;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Builder
public class MinUserinfo implements Serializable {
private static final long SerialVersionUID = 1L;
public class MinUserinfo implements Persistable<String> {
@Id
@Schema(required = true, title = "민원심사사용자코드", example = " ", description = "Input Description...")
@ -70,7 +70,15 @@ public class MinUserinfo implements Serializable {
private String gu;
@Override
public String getId() {
return this.userid;
}
@Override
public boolean isNew() {
return this.userid == null;
}
//@Transient

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*;
import java.io.Serializable;
@ -17,8 +18,7 @@ import java.io.Serializable;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Builder
public class Tf680Recall implements Serializable {
private static final long SerialVersionUID = 1L;
public class Tf680Recall implements Persistable<Long> {
@Id
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@ -202,5 +202,13 @@ public class Tf680Recall implements Serializable {
@Column(name = "rc_sms_send", nullable = true)
private String rcSmsSend;
@Override
public Long getId() {
return this.rcCode;
}
@Override
public boolean isNew() {
return this.rcCode == 0L;
}
}

@ -151,7 +151,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
GnRecallSc entity = repository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
//entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode());
JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
//JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
repository.save(entity);
//---------------------------------------------------------
// 심사자 등록

Loading…
Cancel
Save