공통코드 컬럼 추가, 코드도 저장,수정할 수 있게 추가

This commit is contained in:
2025-12-03 16:36:31 +09:00
parent c3c484442e
commit 46de8c223a
6 changed files with 122 additions and 7 deletions

View File

@@ -61,23 +61,42 @@ public class CommonCodeEntity extends CommonDateEntity {
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<CommonCodeEntity> children = new ArrayList<>();
@Size(max = 255)
@Column(name = "props1")
private String props1;
@Size(max = 255)
@Column(name = "props2")
private String props2;
@Size(max = 255)
@Column(name = "props3")
private String props3;
public CommonCodeEntity(
String code, String name, String description, Integer order, Boolean used) {
String code, String name, String description, Integer order, Boolean used, String props1, String props2, String props3) {
this.code = code;
this.name = name;
this.description = description;
this.order = order;
this.used = used;
this.props1 = props1;
this.props2 = props2;
this.props3 = props3;
}
public CommonCodeEntity(
Long id, String name, String description, Integer order, Boolean used, Boolean deleted) {
Long id, String code, String name, String description, Integer order, Boolean used, Boolean deleted, String props1, String props2, String props3) {
this.id = id;
this.code = code;
this.name = name;
this.description = description;
this.order = order;
this.used = used;
this.deleted = deleted;
this.props1 = props1;
this.props2 = props2;
this.props3 = props3;
}
public CommonCodeDto.Basic toDto() {
@@ -91,7 +110,11 @@ public class CommonCodeEntity extends CommonDateEntity {
this.deleted,
this.children.stream().map(CommonCodeEntity::toDto).toList(),
super.getCreatedDate(),
super.getModifiedDate());
super.getModifiedDate(),
this.props1,
this.props2,
this.props3
);
}
public void addParent(CommonCodeEntity parent) {