Skip to content

Commit 7b0a204

Browse files
committed
added Person Entity
1 parent 6a279cb commit 7b0a204

File tree

3 files changed

+58
-10
lines changed

3 files changed

+58
-10
lines changed
559 KB
Loading

notes

+16-10
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ What if imdb id is set as @Id and tmdb id as a normal column
66
-> then series & movie will have imdb_id as a PK/FK (default) -> no issue
77
imdb_id will be used for
88

9-
10-
11-
129
Issues with tmdb_id
1310
-> tmdb_id can be same for a movie and a series.
1411
Since I want to maintain a common database, I will need to add a letter in id and remove the same while passing it to the 3rd party api
1512

16-
17-
18-
19-
20-
select s1_0.imdb_id,case when s1_1.imdb_id is not null then 1 when s1_2.imdb_id is not null then 2 when s1_0.imdb_id is not null then 0 end,s1_0.backdrop_path,(CASE WHEN EXISTS (SELECT * FROM track_servie.movie m WHERE m.imdb_id = s1_0.imdb_id AND m.watched = 1) THEN 1 ELSE (SELECT CASE WHEN (SELECT COUNT(*) FROM track_servie.episode e WHERE e.series_id=s1_0.id AND e.watched=1)=(SELECT ser.number_of_episodes FROM track_servie.series ser WHERE ser.imdb_id=s1_0.imdb_id) THEN 1 ELSE 0 END) END),s1_0.id,s1_0.original_title,s1_0.overview,s1_0.poster_path,s1_0.status,s1_0.tagline,s1_0.title,s1_1.release_date,s1_1.runtime,s1_1.watched,(SELECT COUNT(*) FROM track_servie.episode e WHERE e.series_id=s1_2.id AND e.watched=1),s1_2.first_air_date,s1_2.last_air_date,s1_2.number_of_episodes,s1_2.number_of_seasons,s1_2.imdb_id,(SELECT CASE WHEN (SELECT COUNT(*) FROM track_servie.episode e WHERE e.series_id=s1_2.id AND e.watched=1)=s1_2.number_of_episodes THEN 1 ELSE 0 END) from servie s1_0 left join movie s1_1 on s1_0.imdb_id=s1_1.imdb_id left join series s1_2 on s1_0.imdb_id=s1_2.imdb_id order by s1_0.title asc limit ?,?];
21-
2213
######################################################################################################################################################
23-
Episode []
14+
Changes to track of each user
15+
16+
Episode
17+
- watched
18+
- stillPath
19+
Season
20+
- watched (not sure, since it can be calculated from episode's watched)
21+
- posterPath
22+
Series
23+
- watched (not sure, since it can be calculated from episode's watched)
24+
Movie
25+
- watched
26+
Servie
27+
- posterPath
28+
- backdropPath
29+
######################################################################################################################################################
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package servie.track_servie.entity;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import jakarta.persistence.Column;
5+
import jakarta.persistence.Entity;
6+
import jakarta.persistence.Id;
7+
import lombok.Data;
8+
9+
@Data
10+
@Entity
11+
public class Person
12+
{
13+
@Column(name = "adult")
14+
private boolean adult;
15+
// ---------------------------------------------------------------
16+
@Column(name = "gender")
17+
private int gender;
18+
// ---------------------------------------------------------------
19+
@Id
20+
@Column(name = "id")
21+
private int id;
22+
// ---------------------------------------------------------------
23+
@Column(name = "known_for_department")
24+
@JsonProperty("known_for_department")
25+
private String knownForDepartment;
26+
// ---------------------------------------------------------------
27+
@Column(name = "name")
28+
private String name;
29+
// ---------------------------------------------------------------
30+
@Column(name = "popularity")
31+
private Float popularity;
32+
// ---------------------------------------------------------------
33+
@Column(name = "profile_path")
34+
@JsonProperty("profile_path")
35+
private String profilePath;
36+
// ---------------------------------------------------------------
37+
@Column(name = "character")
38+
private String character;
39+
// ---------------------------------------------------------------
40+
@Column(name = "order")
41+
private int order;
42+
}

0 commit comments

Comments
 (0)