-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Otavio Santana <[email protected]>
- Loading branch information
1 parent
14b770c
commit acb39e1
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package expert.os.demos.movies; | ||
|
||
public enum movies { | ||
public enum Genre { | ||
ACTION, | ||
COMEDY, | ||
DRAMA, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
package expert.os.demos.movies;public class Movie { | ||
package expert.os.demos.movies; | ||
|
||
import jakarta.nosql.Column; | ||
import jakarta.nosql.Entity; | ||
import jakarta.nosql.Id; | ||
|
||
import java.time.Year; | ||
import java.util.List; | ||
|
||
@Entity | ||
public class Movie { | ||
|
||
@Id | ||
private String id; | ||
|
||
@Column | ||
private String title; | ||
|
||
@Column | ||
private Genre genre; | ||
|
||
@Column | ||
private Year releaseYear; | ||
|
||
@Column | ||
private String director; | ||
|
||
@Column | ||
private List<String> actors; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
package expert.os.demos.movies;public interface MovieRepository { | ||
package expert.os.demos.movies; | ||
|
||
import jakarta.data.repository.BasicRepository; | ||
import jakarta.data.repository.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
public interface MovieRepository extends BasicRepository<Movie, String> { | ||
List<Movie> findByTitle(String title); | ||
List<Movie> findByGenre(Genre genre); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
package expert.os.demos.movies;public class MovieResource { | ||
package expert.os.demos.movies; | ||
|
||
public class MovieResource { | ||
} |