You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.0 KiB
Java

package com.xit.biz.cmm.entity;
import com.xit.biz.cmm.entity.ids.CmmCodeLIds;
import com.xit.core.support.jpa.AuditEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.Hibernate;
import org.hibernate.annotations.ColumnDefault;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
@Schema(name = "CmmCodeL", description = "대분류코드") //, parent = AuditEntity.class)
@Table(name = "tb_cmm_code_l")
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@IdClass(CmmCodeLIds.class)
public class CmmCodeL extends AuditEntity implements Serializable {
@Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM", description = "공통코드그룹ID")
@Id
@Column(name = "code_grp_id", nullable = false, length = 20)
private String codeGrpId;
@Schema(required = true, title = "대분류코드", example = "L0001", description = "대분류 코드값")
@Id
@Column(name = "code_cd", nullable = false, length = 10)
private String codeCd;
@Schema(required = true, title = "대분류코드명", example = "대분류코드명")
@Column(name = "code_nm", nullable = false, length = 20)
private String codeNm;
@Schema(title = "대분류코드상세", example = "대분류코드상세")
@Column(name = "code_remark", length = 50)
private String codeRemark;
@Schema(title = "추가필드1", example = " ")
@Column(name = "code_meta_1", length = 10)
private String codeMeta1;
@Schema(title = "추가필드2", example = " ")
@Column(name = "code_meta_2", length = 10)
private String codeMeta2;
@Schema(title = "추가필드3", example = " ")
@Column(name = "code_meta_3", length = 10)
private String codeMeta3;
@Schema(title = "추가필드4", example = " ")
@Column(name = "code_meta_4", length = 10)
private String codeMeta4;
@Schema(title = "추가필드5", example = " ")
@Column(name = "code_meta_5", length = 10)
private String codeMeta5;
@Schema(required = true, title = "코드정렬순서", example = "99")
@Column(name = "code_ordr", nullable = false, length = 3) //columnDefinition = "int(3)")
@ColumnDefault(value = "99")
private Integer codeOrdr;
/*
@Schema(required = true, title = "그룹코드명", example = "코드예제", description = "코드그룹명")
@Column(name = "code_nm", nullable = false, length = 20)
private String codeNm;
@Schema(title = "그룹코드상세", example = "공통 코드 예제", description = "공통 코드 예제")
@Column(name = "code_remark", length = 50)
private String codeRemark;
@Schema(title = "추가필드1")
@Column(name = "code_meta_1", length = 10)
private String codeMeta1;
@Schema(title = "추가필드2")
@Column(name = "code_meta_2", length = 10)
private String codeMeta2;
@Schema(title = "추가필드3")
@Column(name = "code_meta_3", length = 10)
private String codeMeta3;
@Schema(title = "추가필드4")
@Column(name = "code_meta_4", length = 10)
private String codeMeta4;
@Schema(title = "추가필드5")
@Column(name = "code_meta_5", length = 10)
private String codeMeta5;
@Schema(required = true, title = "코드정렬순서", example = "99")
@Column(name = "code_ordr", nullable = false, length = 3) @ColumnDefault(value = "99")
private Integer codeOrdr;
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
CmmCodeL cmmCodeL = (CmmCodeL) o;
if (!Objects.equals(codeGrpId, cmmCodeL.codeGrpId)) return false;
return Objects.equals(codeCd, cmmCodeL.codeCd);
}
@Override
public int hashCode() {
int result = Objects.hashCode(codeGrpId);
result = 31 * result + (Objects.hashCode(codeCd));
return result;
}
}