From 6e5224de5c0d07706aaa3ec6c466d33d44b617c5 Mon Sep 17 00:00:00 2001 From: seo-young Date: Tue, 5 Mar 2024 16:29:59 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EC=98=81=ED=99=94=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8,=20repository=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../movie/domain/entity/Movie.java | 31 +++++++++++++++++++ .../domain/repository/MovieRepository.java | 9 ++++++ 2 files changed, 40 insertions(+) create mode 100644 src/main/java/com/mookive/mookive_backend/movie/domain/entity/Movie.java create mode 100644 src/main/java/com/mookive/mookive_backend/movie/domain/repository/MovieRepository.java diff --git a/src/main/java/com/mookive/mookive_backend/movie/domain/entity/Movie.java b/src/main/java/com/mookive/mookive_backend/movie/domain/entity/Movie.java new file mode 100644 index 0000000..66b8f2c --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movie/domain/entity/Movie.java @@ -0,0 +1,31 @@ +package com.mookive.mookive_backend.movie.domain.entity; + +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Movie { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String title; + private String year; + private String director; + private String genre; + private String plot; + + @Builder + public Movie(String title, String year, String director, String genre, String plot) { + this.title = title; + this.year = year; + this.director = director; + this.genre = genre; + this.plot = plot; + } +} diff --git a/src/main/java/com/mookive/mookive_backend/movie/domain/repository/MovieRepository.java b/src/main/java/com/mookive/mookive_backend/movie/domain/repository/MovieRepository.java new file mode 100644 index 0000000..f9972b3 --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/movie/domain/repository/MovieRepository.java @@ -0,0 +1,9 @@ +package com.mookive.mookive_backend.movie.domain.repository; + +import com.mookive.mookive_backend.movie.domain.entity.Movie; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface MovieRepository extends JpaRepository { + + Movie findByTitle(String title); +}