-
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.
Merge pull request #13 from TEAM-DAWM/feat/12
[feat] GoogleCalender 엔티티 생성
- Loading branch information
Showing
2 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
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,39 @@ | ||
package nutshell.server.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access= AccessLevel.PROTECTED) | ||
public class GoogleCalender { | ||
@Id | ||
@GeneratedValue(strategy= GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "token", nullable = false, unique = true) | ||
private String token; | ||
|
||
@Column(name = "email", nullable = false, unique = true) | ||
private String email; | ||
|
||
@Column(name = "created_at", nullable = false) | ||
private LocalDateTime createdAt; | ||
|
||
@ManyToOne(targetEntity= User.class, fetch=FetchType.LAZY) | ||
@JoinColumn(name="user_id", nullable = false) | ||
private User user; | ||
|
||
@Builder | ||
public GoogleCalender(String token, String email, User user) { | ||
this.token = token; | ||
this.email = email; | ||
this.user = user; | ||
this.createdAt = LocalDateTime.now(); | ||
} | ||
} |
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