You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.0 KiB
Kotlin

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<Title>
@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())
})
}