Search in sources :

Example 26 with Row

use of io.realm.internal.Row in project realm-java by realm.

the class RealmObjectTests method row_isValid.

// FIXME remove?
@Test
public void row_isValid() {
    realm.beginTransaction();
    RealmObjectProxy realmObject = (RealmObjectProxy) realm.createObject(AllTypes.class);
    Row row = realmObject.realmGet$proxyState().getRow$realm();
    realm.commitTransaction();
    assertNotNull("RealmObject.realmGetRow returns zero ", row);
    assertEquals(9, row.getColumnCount());
}
Also used : RealmObjectProxy(io.realm.internal.RealmObjectProxy) AllTypes(io.realm.entities.AllTypes) Row(io.realm.internal.Row) UiThreadTest(android.support.test.annotation.UiThreadTest) Test(org.junit.Test)

Example 27 with Row

use of io.realm.internal.Row in project realm-java by realm.

the class NullTypesRealmProxy method realmSet$fieldStringNotNull.

public void realmSet$fieldStringNotNull(String value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            throw new IllegalArgumentException("Trying to set non-nullable field 'fieldStringNotNull' to null.");
        }
        row.getTable().setString(columnInfo.fieldStringNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldStringNotNull' to null.");
    }
    proxyState.getRow$realm().setString(columnInfo.fieldStringNotNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 28 with Row

use of io.realm.internal.Row in project realm-java by realm.

the class SimpleRealmProxy method realmSet$age.

public void realmSet$age(int value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        row.getTable().setLong(columnInfo.ageIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    proxyState.getRow$realm().setLong(columnInfo.ageIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 29 with Row

use of io.realm.internal.Row in project realm-java by realm.

the class SimpleRealmProxy method realmSet$name.

public void realmSet$name(String value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            row.getTable().setNull(columnInfo.nameIndex, row.getIndex(), true);
            return;
        }
        row.getTable().setString(columnInfo.nameIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        proxyState.getRow$realm().setNull(columnInfo.nameIndex);
        return;
    }
    proxyState.getRow$realm().setString(columnInfo.nameIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 30 with Row

use of io.realm.internal.Row in project realm-java by realm.

the class NullTypesRealmProxy method realmSet$fieldDateNotNull.

public void realmSet$fieldDateNotNull(Date value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            throw new IllegalArgumentException("Trying to set non-nullable field 'fieldDateNotNull' to null.");
        }
        row.getTable().setDate(columnInfo.fieldDateNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldDateNotNull' to null.");
    }
    proxyState.getRow$realm().setDate(columnInfo.fieldDateNotNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Aggregations

Row (io.realm.internal.Row)38 RealmObjectProxy (io.realm.internal.RealmObjectProxy)6 InvalidRow (io.realm.internal.InvalidRow)2 UiThreadTest (android.support.test.annotation.UiThreadTest)1 AllTypes (io.realm.entities.AllTypes)1 Collection (io.realm.internal.Collection)1 PendingRow (io.realm.internal.PendingRow)1 Test (org.junit.Test)1