Newer
Older
bremer / src / main / kotlin / entity / Playlist.kt
yhornisse on 2 Jul 2023 854 bytes add project
/*
 * Copyright (c) 2023. yo-saito. All Rights Reserved.
 */

package net.piedpiper.bremer.entity

import net.piedpiper.bremer.utils.sql.Column
import net.piedpiper.bremer.utils.sql.Table


@Table("playlist")
data class PlaylistEntity(
    @property:Column("id", insertable = false, updatable = false)
    var id: Long = 0L,
    @property:Column("slug")
    var slug: String = "",
    @property:Column("name")
    var name: String = "",
    // join
    var playlistAudio: List<PlaylistAudioEntity> = mutableListOf()
)

@Table("playlist_audio")
data class PlaylistAudioEntity(
    @property:Column("id", insertable = false, updatable = false)
    var id: Long = 0L,
    @property:Column("playlist_id")
    var playlistId: Long = 0L,
    @property:Column("sequence")
    var sequence: Int = 0,
    @property:Column("audio_id")
    var audioId: Long = 0L
)