diff --git a/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java new file mode 100644 index 0000000..86511cf --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/entity/MovieInPlaylist.java @@ -0,0 +1,32 @@ +package com.mookive.mookive_backend.movieInPlaylist.domain.entity; + +import com.mookive.mookive_backend.movie.domain.entity.Movie; +import com.mookive.mookive_backend.playlist.domain.entity.Playlist; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class MovieInPlaylist { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + @JoinColumn(name = "playlist_id") + private Playlist playlist; + + @ManyToOne + @JoinColumn(name = "movie_id") + private Movie movie; + + @Builder + public MovieInPlaylist(Playlist playlist, Movie movie) { + this.playlist = playlist; + this.movie = movie; + } +} diff --git a/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java new file mode 100644 index 0000000..befbaa1 --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movieInPlaylist/domain/respository/MovieInPlaylistRepository.java @@ -0,0 +1,7 @@ +package com.mookive.mookive_backend.movieInPlaylist.domain.respository; + +import com.mookive.mookive_backend.movieInPlaylist.domain.entity.MovieInPlaylist; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface MovieInPlaylistRepository extends JpaRepository { +}