-
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.
- Loading branch information
Showing
5 changed files
with
153 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.sparta.binplay.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name="ads") | ||
@NoArgsConstructor | ||
public class Ads extends Timestamped{ | ||
@Id | ||
@Column(name = "ad_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long adId; | ||
|
||
@OneToMany(mappedBy = "ad") | ||
private List<VideoAd> videoAds; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.sparta.binplay.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name="statistics") | ||
@NoArgsConstructor | ||
public class Statistics extends Timestamped{ | ||
@Id | ||
@Column(name = "stat_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long statId; | ||
|
||
@Column(name="period", nullable = false) | ||
private String period; | ||
|
||
@Column(name="period_views", nullable = false) | ||
private Long periodViews; | ||
|
||
@Column(name="total_viewing_time", nullable = false) | ||
private Integer totalViewingTime; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "video_id", nullable = false) | ||
private Videos video; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.sparta.binplay.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name="streams") | ||
@NoArgsConstructor | ||
public class Streams extends Timestamped{ | ||
@Id | ||
@Column(name = "stream_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long streamId; | ||
|
||
@Column(name="viewing_time", nullable = false) | ||
private Integer viewingTime; | ||
|
||
@Column(name="paused_at", nullable = false) | ||
private Integer pausedAt; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_id", nullable = false) | ||
private Users user; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "video_id", nullable = false) | ||
private Videos video; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.sparta.binplay.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name="video_ads") | ||
@NoArgsConstructor | ||
public class VideoAd { | ||
@Id | ||
@Column(name = "video_ad_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long videoAdId; | ||
|
||
@Column(name = "ad_views", nullable = false) | ||
private int adViews; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "video_id", nullable = false) | ||
private Videos video; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "ad_id", nullable = false) | ||
private Ads ad; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.sparta.binplay.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name="videos") | ||
@NoArgsConstructor | ||
public class Videos extends Timestamped{ | ||
@Id | ||
@Column(name = "video_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long videoId; | ||
|
||
@Column(name="title", nullable = false) | ||
private String title; | ||
|
||
@Column(name="description") | ||
private String description; | ||
|
||
@Column(name="views", nullable = false) | ||
private Long views; | ||
|
||
@Column(name="video_length", nullable = false) | ||
private Integer videoLength; | ||
|
||
@Column(name="ad_position", nullable = false) | ||
private Integer adPosition; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_id", nullable = false) | ||
private Users user; | ||
|
||
@OneToMany(mappedBy = "video") | ||
private List<Streams> streams; | ||
|
||
@OneToMany(mappedBy = "video") | ||
private List<VideoAd> videoAds; | ||
|
||
@OneToMany(mappedBy = "video") | ||
private List<Statistics> statistics; | ||
} |