use of io.realm.entities.NonLatinFieldNames in project realm-java by realm.
the class RealmResultsTests method populateTestRealm.
// distinctAsync
private void populateTestRealm(int objects) {
realm.beginTransaction();
realm.deleteAll();
for (int i = 0; i < objects; ++i) {
AllTypes allTypes = realm.createObject(AllTypes.class);
allTypes.setColumnBoolean((i % 2) == 0);
allTypes.setColumnBinary(new byte[] { 1, 2, 3 });
allTypes.setColumnDate(new Date(YEAR_MILLIS * (i - objects / 2)));
allTypes.setColumnDouble(3.1415 + i);
allTypes.setColumnFloat(1.234567f + i);
allTypes.setColumnString("test data " + i);
allTypes.setColumnLong(i);
Dog d = realm.createObject(Dog.class);
d.setName("Foo " + i);
allTypes.setColumnRealmObject(d);
allTypes.getColumnRealmList().add(d);
NonLatinFieldNames nonLatinFieldNames = realm.createObject(NonLatinFieldNames.class);
nonLatinFieldNames.set델타(i);
nonLatinFieldNames.setΔέλτα(i);
}
realm.commitTransaction();
}
use of io.realm.entities.NonLatinFieldNames in project realm-java by realm.
the class RealmQueryTests method populateTestRealm.
private void populateTestRealm(Realm testRealm, int dataSize) {
testRealm.beginTransaction();
testRealm.deleteAll();
for (int i = 0; i < dataSize; ++i) {
AllTypes allTypes = testRealm.createObject(AllTypes.class);
allTypes.setColumnBoolean((i % 3) == 0);
allTypes.setColumnBinary(new byte[] { 1, 2, 3 });
allTypes.setColumnDate(new Date(DECADE_MILLIS * (i - (dataSize / 2))));
allTypes.setColumnDouble(3.1415);
allTypes.setColumnFloat(1.234567f + i);
allTypes.setColumnString("test data " + i);
allTypes.setColumnLong(i);
NonLatinFieldNames nonLatinFieldNames = testRealm.createObject(NonLatinFieldNames.class);
nonLatinFieldNames.set델타(i);
nonLatinFieldNames.setΔέλτα(i);
nonLatinFieldNames.set베타(1.234567f + i);
nonLatinFieldNames.setΒήτα(1.234567f + i);
Dog dog = testRealm.createObject(Dog.class);
dog.setAge(i);
dog.setName("test data " + i);
allTypes.setColumnRealmObject(dog);
}
testRealm.commitTransaction();
}
use of io.realm.entities.NonLatinFieldNames in project realm-java by realm.
the class RealmAsyncQueryTests method populateTestRealm.
// *** Helper methods ***
private void populateTestRealm(final Realm testRealm, int objects) {
testRealm.setAutoRefresh(false);
testRealm.beginTransaction();
testRealm.deleteAll();
for (int i = 0; i < objects; ++i) {
AllTypes allTypes = testRealm.createObject(AllTypes.class);
allTypes.setColumnBoolean((i % 3) == 0);
allTypes.setColumnBinary(new byte[] { 1, 2, 3 });
allTypes.setColumnDate(new Date());
allTypes.setColumnDouble(3.1415);
allTypes.setColumnFloat(1.234567f + i);
allTypes.setColumnString("test data " + i);
allTypes.setColumnLong(i);
NonLatinFieldNames nonLatinFieldNames = testRealm.createObject(NonLatinFieldNames.class);
nonLatinFieldNames.set델타(i);
nonLatinFieldNames.setΔέλτα(i);
nonLatinFieldNames.set베타(1.234567f + i);
nonLatinFieldNames.setΒήτα(1.234567f + i);
}
testRealm.commitTransaction();
testRealm.setAutoRefresh(true);
}
use of io.realm.entities.NonLatinFieldNames in project realm-java by realm.
the class CollectionTests method populateRealm.
protected void populateRealm(Realm realm, int objects) {
realm.beginTransaction();
realm.delete(AllJavaTypes.class);
realm.delete(NonLatinFieldNames.class);
if (objects > 0) {
for (int i = 0; i < objects; i++) {
AllJavaTypes obj = realm.createObject(AllJavaTypes.class, i);
fillObject(i, objects, obj);
NonLatinFieldNames nonLatinFieldNames = realm.createObject(NonLatinFieldNames.class);
nonLatinFieldNames.set델타(i);
nonLatinFieldNames.setΔέλτα(i);
// Sets the linked object to itself.
obj.setFieldObject(obj);
}
// Adds all items to the RealmList on the first object.
AllJavaTypes firstObj = realm.where(AllJavaTypes.class).equalTo(AllJavaTypes.FIELD_ID, 0).findFirst();
RealmResults<AllJavaTypes> listData = realm.where(AllJavaTypes.class).findAllSorted(AllJavaTypes.FIELD_ID, Sort.ASCENDING);
RealmList<AllJavaTypes> list = firstObj.getFieldList();
for (int i = 0; i < listData.size(); i++) {
list.add(listData.get(i));
}
}
realm.commitTransaction();
}
use of io.realm.entities.NonLatinFieldNames in project realm-java by realm.
the class RealmTests method populateTestRealm.
private void populateTestRealm(Realm realm, int objects) {
realm.beginTransaction();
realm.deleteAll();
for (int i = 0; i < objects; ++i) {
AllTypes allTypes = realm.createObject(AllTypes.class);
allTypes.setColumnBoolean((i % 3) == 0);
allTypes.setColumnBinary(new byte[] { 1, 2, 3 });
allTypes.setColumnDate(new Date());
allTypes.setColumnDouble(3.1415);
allTypes.setColumnFloat(1.234567f + i);
allTypes.setColumnString("test data " + i);
allTypes.setColumnLong(i);
NonLatinFieldNames nonLatinFieldNames = realm.createObject(NonLatinFieldNames.class);
nonLatinFieldNames.set델타(i);
nonLatinFieldNames.setΔέλτα(i);
nonLatinFieldNames.set베타(1.234567f + i);
nonLatinFieldNames.setΒήτα(1.234567f + i);
}
realm.commitTransaction();
}
Aggregations