-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
init: Entities
- Loading branch information
Showing
7 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/com/soongsil/CoffeeChat/entity/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.soongsil.CoffeeChat.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
public class Application { | ||
@Column(name = "application_id") | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "mentor_id") | ||
private Mentor mentor; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "mentee_id") | ||
private Mentee mentee; | ||
|
||
@Column | ||
private String date; | ||
|
||
@Column | ||
private String time; | ||
|
||
@Column | ||
private String question; | ||
|
||
@Column | ||
private boolean accept; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.soongsil.CoffeeChat.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
public class Club { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name="club_id") | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "mentor_id") | ||
private Mentor mentor; | ||
|
||
@Column | ||
private String name; | ||
|
||
@Column | ||
private String position; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.soongsil.CoffeeChat.entity; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.OneToMany; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
public class Mentee extends User{ | ||
@Column(name = "phone_num") | ||
private String phoneNum; | ||
|
||
@Column | ||
private String birth; | ||
|
||
@Column | ||
private String part; | ||
|
||
@OneToMany(mappedBy = "mentee", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private Set<Application> applications = new HashSet<>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.soongsil.CoffeeChat.entity; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.OneToMany; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
public class Mentor extends User{ | ||
@Column | ||
private int grade; | ||
|
||
@Column | ||
private String major; | ||
|
||
@Column | ||
private String memo; | ||
|
||
@OneToMany(mappedBy = "mentor", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private Set<Application> applications = new HashSet<>(); | ||
|
||
@OneToMany(mappedBy = "mentor", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private Set<Club> clubs = new HashSet<>(); | ||
|
||
@OneToMany(mappedBy = "mentor", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private Set<PossibleDate> possibleDates = new HashSet<>(); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/soongsil/CoffeeChat/entity/PossibleDate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.soongsil.CoffeeChat.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
public class PossibleDate { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "possible_date_id") | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "mentor_id") | ||
private Mentor mentor; | ||
|
||
@Column | ||
private String date; | ||
|
||
@Column | ||
private String time; | ||
|
||
@Column | ||
private boolean apply; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters