JvmOverloads annotation for class primary constructor

It’s not prohibited, you are just applying @JvmOverloads to the wrong target. The proper way to annotate primary constructor is to explicitly specify constructor keyword with @JvmOverloads before:

class Video @JvmOverloads constructor(
    private val id: Long,
    val ownerId: Long,
    var title: String? = null,
    var imgLink: String? = null,
    var videoLink: String? = null,
    var description: String? = null,
    var created: Date? = null,
    var accessKey: String? = null,
    var duration: Long? = null,
    var views: Long? = null,
    var comments: Long? = null
) : Entity

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)