Skip to content

Commit

Permalink
Merge pull request #57 from MarketPlace-O2O-Platform/feat/#56
Browse files Browse the repository at this point in the history
[Feat] 광역시/도 & 시/구 테이블 생성 - #56
  • Loading branch information
kangwook1 authored Nov 21, 2024
2 parents 5772166 + e9c90e0 commit c198a88
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/com/appcenter/marketplace/domain/local/Local.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.appcenter.marketplace.domain.local;


import com.appcenter.marketplace.domain.metro.Metro;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;



@Table(name = "local_government")
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Local {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false)
private String name;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "metropolitan_government_id",nullable = false)
private Metro metro;
}

23 changes: 23 additions & 0 deletions src/main/java/com/appcenter/marketplace/domain/metro/Metro.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.appcenter.marketplace.domain.metro;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;


@Table(name = "metropolitan_government")
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Metro {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false)
private String name;


}

0 comments on commit c198a88

Please sign in to comment.