forked from solid-connection/solid-connect-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountry.java
More file actions
34 lines (28 loc) · 869 Bytes
/
Country.java
File metadata and controls
34 lines (28 loc) · 869 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
package com.example.solidconnection.location.country.domain;
import com.example.solidconnection.location.region.domain.Region;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
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;
@ManyToOne
private Region region;
public Country(String code, String koreanName, Region region) {
this.code = code;
this.koreanName = koreanName;
this.region = region;
}
}