Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
io.realm.annotations

Annotation Type RealmClass

Implemented interfaces:

  • java.lang.annotation.Annotation

Interface used to mark a class that can be persisted by Realm.

Modificador y Tipo
Optional Element and Description

public booleano

Definir los objetos de este tipo como "Incrustados".

The naming policy applied to all fields in this class.

public String

Manually set the internal name used by Realm for this class.

public String

Manually set the internal name used by Realm for this class.

integrado

public boolean embedded

Define objects of this type as "Embedded". Embedded objects have a slightly different behavior than normal objects:

  • They must have exactly 1 parent linking to them when the embedded object is added to the Realm. Embedded objects can be the parent of other embedded objects. The parent cannot be changed later, except by copying the object.

  • No pueden tener campos anotados con @PrimaryKey .

  • When a parent object is deleted, all embedded objects are also deleted.

  • It is possible to define an easy reference to the parent object using the @LinkingObjects annotation:

    @LinkingObjects
    public Parent parent;

Por defecto: false

fieldNamingPolicy

public RealmNamingPolicy fieldNamingPolicy

The naming policy applied to all fields in this class. The default policy is RealmNamingPolicy.NO_POLICY .

Es posible anular la política de nombres para cada campo utilizando la anotación RealmField.

Por defecto: io.realm.annotations.RealmNamingPolicy.NO_POLICY

Tip

Nombre

public String name

Manually set the internal name used by Realm for this class. If this class is part of any modules, this will also override any name policy set using RealmModule.classNamingPolicy() .

Por defecto: ""

Valor

public String value

Manually set the internal name used by Realm for this class. If this class is part of any modules, this will also override any name policy set using RealmModule.classNamingPolicy() .

Por defecto: ""

Volver

llave primaria

En esta página