66 lines
1.4 KiB
Java
66 lines
1.4 KiB
Java
package com.magamochi.model.entity;
|
|
|
|
import jakarta.persistence.*;
|
|
import java.time.Instant;
|
|
import java.time.OffsetDateTime;
|
|
import java.util.List;
|
|
import lombok.*;
|
|
import org.hibernate.annotations.CreationTimestamp;
|
|
import org.hibernate.annotations.UpdateTimestamp;
|
|
|
|
@Entity
|
|
@Table(name = "mangas")
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Getter
|
|
@Setter
|
|
public class Manga {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
private Long malId;
|
|
|
|
private Long aniListId;
|
|
|
|
private String title;
|
|
|
|
private String status;
|
|
|
|
private String synopsis;
|
|
|
|
@CreationTimestamp private Instant createdAt;
|
|
|
|
@UpdateTimestamp private Instant updatedAt;
|
|
|
|
@OneToMany(mappedBy = "manga")
|
|
private List<MangaProvider> mangaProviders;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "cover_image_id")
|
|
private Image coverImage;
|
|
|
|
private Double score;
|
|
|
|
private OffsetDateTime publishedFrom;
|
|
|
|
private OffsetDateTime publishedTo;
|
|
|
|
@OneToMany(mappedBy = "manga")
|
|
private List<MangaAuthor> mangaAuthors;
|
|
|
|
@OneToMany(mappedBy = "manga")
|
|
private List<MangaGenre> mangaGenres;
|
|
|
|
@OneToMany(mappedBy = "manga")
|
|
private List<UserFavoriteManga> userFavoriteMangas;
|
|
|
|
@OneToMany(mappedBy = "manga")
|
|
private List<MangaAlternativeTitle> alternativeTitles;
|
|
|
|
@Builder.Default private Integer chapterCount = 0;
|
|
|
|
@Builder.Default private Boolean follow = false;
|
|
}
|