ConstructedBy
-
Cmn
@Target(allowedTargets = [AnnotationTarget.CLASS])
@Retention(value = AnnotationRetention.BINARY)
annotation ConstructedBy -
NJS
@<Error class: unknown class>
@Target(allowedTargets = [AnnotationTarget.CLASS])
@Retention(value = AnnotationRetention.BINARY)
annotation ConstructedBy
Defines the androidx.room.RoomDatabaseConstructor that will instantiate the Room generated implementation of the annotated Database.
A androidx.room.RoomDatabase database definition must be annotated with this annotation if it is located in a common source set on a Kotlin Multiplatform project such that at runtime the implementation generated by the annotation processor can be used. The value must be an 'expect object' that implements androidx.room.RoomDatabaseConstructor.
Example usage:
@Database(version = 1, entities = [Song::class, Album::class])
@ConstructedBy(MusicDatabaseConstructor::class)
abstract class MusicDatabase : RoomDatabase
expect object MusicDatabaseConstructor : RoomDatabaseConstructor<MusicDatabase>
| See also | |
|---|---|
RoomDatabaseConstructor |
Summary
Public constructors |
|
|---|---|
ConstructedBy(value: KClass<*>) |
Cmn
android
N
JS
|
Public properties |
||
|---|---|---|
KClass<*> |
The 'expect' declaration of an 'object' that implements |
Cmn
android
N
JS
|
Public constructors
Public properties
value
val value: KClass<*>
The 'expect' declaration of an 'object' that implements androidx.room.RoomDatabaseConstructor and is able to instantiate a androidx.room.RoomDatabase.