Skip to content

Commit

Permalink
Merge pull request #11 from GDSC-snowflowerthon/feature/9
Browse files Browse the repository at this point in the history
[Feature] goal 등록 수정
  • Loading branch information
Haewonny authored Jan 12, 2024
2 parents 3787dfe + c4dacad commit b5dc491
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/tenten/blooming/domain/goal/dto/GoalDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public Goal toEntity() {
goal.setGoalName(goalName);
goal.setCreatedAt(LocalDate.now());
goal.setIsActivate(true);
goal.setUserId(userId);

return goal;
}
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/tenten/blooming/domain/goal/entity/Goal.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ public class Goal {
@Column(name = "is_activate")
private Boolean isActivate;

@ManyToOne
@JoinColumn(name = "user_id")
@ManyToOne(targetEntity = User.class)
@JoinColumn(name = "user_id", insertable = false, updatable = false)
private User user;

@Column(name = "user_id")
private Long userId;

@OneToMany(mappedBy = "goal")
private List<Subgoal> subgoals = new ArrayList<>();


}

0 comments on commit b5dc491

Please sign in to comment.