io.realm.annotations
Implemented interfaces:
La anotación @PrimaryKey marcará un campo como clave principal dentro de Realm. Solo un campo en una clase RealmObject puede tener esta anotación, y el campo debe identificar de forma única el objeto. Intentar insertar un objeto con una clave principal existente resultará en un io.realm.exceptions.RealmPrimaryKeyConstraintException La clave principal no se puede cambiar una vez creado el objeto.
Primary keys also count as having the Index annotation.
It is allowed to apply this annotation on the following primitive types: byte, short, int, and long. String, Byte, Short, Integer, Long, ObjectId and UUID are also allowed, and further permitted to have null as a primary key value.
This annotation is not allowed inside Realm classes marked as @RealmClass(embedded = true) .