Skip to content

Commit

Permalink
[feat] MovieInPlaylist 도메인, repository 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
syyling committed Mar 7, 2024
1 parent 9944d84 commit d9fc388
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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<MovieInPlaylist, Long> {
}

0 comments on commit d9fc388

Please sign in to comment.