PrimaryKey

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class PrimaryKey

Annotation marking a field as a primary key inside Realm.

Only one field in a RealmObject class can have this annotation, and the field should uniquely identify the object.

This annotation applies to the following primitive types: String, Byte, Char, Short, Int and Long, as well as their nullable variants.

Constructors

PrimaryKey
Link copied to clipboard
fun PrimaryKey()