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

Class RealmSchema

java.lang.Object
io.realm.RealmSchema

Clase para interactuar con el esquema de Realm. Esto permite inspeccionar, añadir, eliminar y modificar las clases en Realm.Realm.getSchema() <io_realm_Realm_getSchema__> Devuelve un inmutable RealmSchema que solo se puede usar para inspección. Use DynamicRealm.getSchema() para obtener un esquema mutable.

All changes must happen inside a write transaction for the particular Realm.

Tip

  • RealmMigration

Modificador y Tipo
Método y descripción

public booleano

String className
)

Checks if a given class already exists in the schema.

public abstract RealmObjectSchema

String className
)

Agrega una nueva clase al Realm.

public void

Create the underlying keypath mapping.

public abstract RealmObjectSchema

String className,
String primaryKeyFieldName,
)

Agrega una nueva clase al Reino con un campo de clave principal definido.

public abstract RealmObjectSchema

get (
String className
)

Returns the RealmObjectSchema for a given class.

public abstract Set

Returns the RealmObjectSchema s for all RealmObject classes that can be saved in this Realm.

protected final ColumnInfo

String className
)

public abstract void

String className
)

Removes a class from the Realm.

public abstract RealmObjectSchema

String oldClassName,
String newClassName
)

Renombra una clase ya existente en el Realm.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public boolean contains (
String className
)

Checks if a given class already exists in the schema.

Parámetros

  • className - class name to check.

Devuelve

true si la clase ya existe. false en caso contrario.

public abstract RealmObjectSchema create (
String className
)

Agrega una nueva clase al Realm.

Parámetros

  • className - nombre de la clase.

Devuelve

un objeto de esquema Realm para esa clase.

Throws

public void createKeyPathMapping ()

Create the underlying keypath mapping. Should only be called by typed Realms.

String className,
String primaryKeyFieldName,
)

Agrega una nueva clase al Reino con un campo de clave principal definido.

Parámetros

  • className - nombre de la clase.

  • primaryKeyFieldName - name of the primary key field.

  • fieldType - type of field to add. Only byte , short , int , long and their boxed types or the String is supported.

  • attributes - Conjunto de atributos para este campo. Este método añade implícitamente los atributos FieldAttribute.PRIMARY_KEY y FieldAttribute.INDEXED al campo.

Devuelve

un objeto de esquema Realm para esa clase.

Throws

public abstract RealmObjectSchema get (
String className
)

Returns the RealmObjectSchema for a given class. If this RealmSchema is immutable, an immutable RealmObjectSchema will be returned. Otherwise, it returns a mutable RealmObjectSchema .

Parámetros

  • className - name of the class

Devuelve

esquema objeto para esa clase o null si la clase no existe.

public abstract Set getAll ()

Returns the RealmObjectSchema s for all RealmObject classes that can be saved in this Realm. If this RealmSchema is immutable, an immutable RealmObjectSchema set will be returned. Otherwise, it returns an mutable RealmObjectSchema set.

Devuelve

el conjunto de todas las clases en este Reino o ninguna clase RealmObject se puede guardar en el Reino.

protected final ColumnInfo getColumnInfo (
String className
)
public abstract void remove (
String className
)

Removes a class from the Realm. All data will be removed. Removing a class while other classes point to it will throw an IllegalStateException . Removes those classes or fields first.

Parámetros

  • className - nombre de la clase que se removerá.

Throws

public abstract RealmObjectSchema rename (
String oldClassName,
String newClassName
)

Renombra una clase ya existente en el Realm.

Parámetros

  • oldClassName - old class name.

  • newClassName - new class name.

Devuelve

un objeto de esquema para la clase renombrada.

Throws

Volver

RealmResults

En esta página