Skip to content

Commit

Permalink
BE: [feat] 크루 프로필 엔티티 추가 CSID-DGU#83
Browse files Browse the repository at this point in the history
  • Loading branch information
Seoyoung2222 committed Nov 27, 2024
1 parent ff5f9d1 commit b582057
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ public class Crew extends BaseEntity {

@OneToMany(mappedBy = "crew")
private List<CrewPost> crewPosts = new ArrayList<>();

@OneToOne(mappedBy = "crew")
private CrewProfileImage images = new CrewProfileImage();

public void setImages(CrewProfileImage profileImage) {
this.images = profileImage;
profileImage.setCrew(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package RunningMachines.R2R.domain.crew.common.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class CrewProfileImage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private Long id;

@OneToOne
@JoinColumn(name = "crew_id", nullable = false)
private Crew crew;

private String imageUrl;

public void setCrew(Crew crew) {
this.crew = crew;
}
}

0 comments on commit b582057

Please sign in to comment.