package moe.odango.index.entity import io.requery.* import moe.odango.index.utils.EntityHelper import moe.odango.index.utils.helper import java.util.* @Entity interface Anime : Persistable { @get:Key val id: UUID @get:Index var aniDbId: Long? @get:OneToOne val aniDbInfo: AniDBInfo? @get:OneToMany(mappedBy = "anime") val titles: List @get:Index var myAnimeListId: Long? @get:ManyToMany @get:JunctionTable(type = AnimeProducer::class) val producers: List<Producer> @get:OneToOne val myAnimeListInfo: MyAnimeListInfo? @get:OneToMany(mappedBy = "anime_from") val relatedTo: List<AnimeRelation> @get:OneToMany(mappedBy = "anime_to") val relatedFrom: List<AnimeRelation> @get:OneToMany(mappedBy = "anime") val genres: List<AnimeGenre> @get:ManyToOne @get:ForeignKey var series: AnimeSeries? val replacedWith: UUID? companion object : EntityHelper<AnimeEntity> by helper(::AnimeEntity, { setId(UUID.randomUUID()) }) }