-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCountry.java
More file actions
40 lines (32 loc) · 998 Bytes
/
Country.java
File metadata and controls
40 lines (32 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.example.solidconnection.location.country.domain;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@EqualsAndHashCode(of = {"code", "koreanName"})
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
public class Country {
@Id
@Column(length = 2)
private String code;
@Column(nullable = false, length = 100)
private String koreanName;
@Column(name = "region_code")
private String regionCode;
public Country(String code, String koreanName, String regionCode) {
this.code = code;
this.koreanName = koreanName;
this.regionCode = regionCode;
}
public void updateKoreanName(String koreanName) {
this.koreanName = koreanName;
}
public void updateRegionCode(String regionCode) {
this.regionCode = regionCode;
}
}