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 lombok.*;
import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
@ -17,8 +18,7 @@ import java.io.Serializable;
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter @Getter
@Builder @Builder
public class MinCivBoard680 implements Serializable { public class MinCivBoard680 implements Persistable<Long> {
private static final long SerialVersionUID = 1L;
@Id @Id
@Schema(required = true, title = "게시판코드", example = " ", description = "Input Description...") @Schema(required = true, title = "게시판코드", example = " ", description = "Input Description...")
@ -85,5 +85,13 @@ public class MinCivBoard680 implements Serializable {
@Column(name = "ci_ip", nullable = true) @Column(name = "ci_ip", nullable = true)
private String ciIp; 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 lombok.*;
import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDate; import java.time.LocalDate;
@ -17,15 +18,13 @@ import java.time.LocalDate;
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
@Builder @Builder
public class MinSimsa680 { //implements Serializable { public class MinSimsa680 implements Persistable<Long> {
//private static final long SerialVersionUID = 1L;
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...") @Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@Id @Id
@Column(name = "ms_maincode") @Column(name = "ms_maincode")
private Long msMaincode; private Long msMaincode;
@Schema(required = true, title = "접수번호", example = " ", description = "Input Description...") @Schema(required = true, title = "접수번호", example = " ", description = "Input Description...")
@Column(name = "ms_seq", nullable = false) @Column(name = "ms_seq", nullable = false)
private String msSeq; private String msSeq;
@ -78,4 +77,13 @@ public class MinSimsa680 { //implements Serializable {
@Column(name = "ms_jbtime", nullable = true) @Column(name = "ms_jbtime", nullable = true)
private String msJbtime; 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 lombok.*;
import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -20,15 +21,13 @@ import java.time.LocalDate;
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter @Getter
@Builder @Builder
public class MinSimsa680Sc { //implements Serializable { public class MinSimsa680Sc implements Persistable<Long> {
//private static final long SerialVersionUID = 1L;
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...") @Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@Id @Id
@Column(name = "ms_maincode") @Column(name = "ms_maincode")
private Long msMaincode; private Long msMaincode;
@Schema(required = true, title = "접수번호", example = " ", description = "Input Description...") @Schema(required = true, title = "접수번호", example = " ", description = "Input Description...")
@Column(name = "ms_seq", nullable = false) @Column(name = "ms_seq", nullable = false)
private String msSeq; private String msSeq;
@ -84,4 +83,14 @@ public class MinSimsa680Sc { //implements Serializable {
@Schema(required = false, title = "데이타구분", example = "1", description = "데이타구분: 1-거주자, 2-장애인") @Schema(required = false, title = "데이타구분", example = "1", description = "데이타구분: 1-거주자, 2-장애인")
@Column(name = "ms_datagb", nullable = false) @Column(name = "ms_datagb", nullable = false)
private String msDatagb; 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 lombok.*;
import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
@ -21,8 +22,7 @@ import java.util.Set;
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter @Getter
@Builder @Builder
public class MinUserinfo implements Serializable { public class MinUserinfo implements Persistable<String> {
private static final long SerialVersionUID = 1L;
@Id @Id
@Schema(required = true, title = "민원심사사용자코드", example = " ", description = "Input Description...") @Schema(required = true, title = "민원심사사용자코드", example = " ", description = "Input Description...")
@ -70,7 +70,15 @@ public class MinUserinfo implements Serializable {
private String gu; private String gu;
@Override
public String getId() {
return this.userid;
}
@Override
public boolean isNew() {
return this.userid == null;
}
//@Transient //@Transient

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
@ -17,8 +18,7 @@ import java.io.Serializable;
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter @Getter
@Builder @Builder
public class Tf680Recall implements Serializable { public class Tf680Recall implements Persistable<Long> {
private static final long SerialVersionUID = 1L;
@Id @Id
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...") @Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
@ -202,5 +202,13 @@ public class Tf680Recall implements Serializable {
@Column(name = "rc_sms_send", nullable = true) @Column(name = "rc_sms_send", nullable = true)
private String rcSmsSend; 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)); GnRecallSc entity = repository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode()); entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
//entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.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