Skip to content

Commit

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

Movie findByTitle(String title);
}

0 comments on commit 6e5224d

Please sign in to comment.