コード例 #1
0
 public static void insertOrUpdate(
     Realm realm, Iterator<? extends RealmModel> objects, Map<RealmModel, Long> cache) {
   Table table = realm.getTable(some.test.Booleans.class);
   long tableNativePtr = table.getNativeTablePointer();
   BooleansColumnInfo columnInfo =
       (BooleansColumnInfo) realm.schema.getColumnInfo(some.test.Booleans.class);
   some.test.Booleans object = null;
   while (objects.hasNext()) {
     object = (some.test.Booleans) objects.next();
     if (!cache.containsKey(object)) {
       long rowIndex = Table.nativeAddEmptyRow(tableNativePtr, 1);
       cache.put(object, rowIndex);
       Table.nativeSetBoolean(
           tableNativePtr,
           columnInfo.doneIndex,
           rowIndex,
           ((BooleansRealmProxyInterface) object).realmGet$done());
       Table.nativeSetBoolean(
           tableNativePtr,
           columnInfo.isReadyIndex,
           rowIndex,
           ((BooleansRealmProxyInterface) object).realmGet$isReady());
       Table.nativeSetBoolean(
           tableNativePtr,
           columnInfo.mCompletedIndex,
           rowIndex,
           ((BooleansRealmProxyInterface) object).realmGet$mCompleted());
       Table.nativeSetBoolean(
           tableNativePtr,
           columnInfo.anotherBooleanIndex,
           rowIndex,
           ((BooleansRealmProxyInterface) object).realmGet$anotherBoolean());
     }
   }
 }
コード例 #2
0
 public static void insertOrUpdate(
     Realm realm, Iterator<? extends RealmModel> objects, Map<RealmModel, Long> cache) {
   Table table = realm.getTable(some.test.Simple.class);
   long tableNativePtr = table.getNativeTablePointer();
   SimpleColumnInfo columnInfo =
       (SimpleColumnInfo) realm.schema.getColumnInfo(some.test.Simple.class);
   some.test.Simple object = null;
   while (objects.hasNext()) {
     object = (some.test.Simple) objects.next();
     if (!cache.containsKey(object)) {
       long rowIndex = Table.nativeAddEmptyRow(tableNativePtr, 1);
       cache.put(object, rowIndex);
       String realmGet$name = ((SimpleRealmProxyInterface) object).realmGet$name();
       if (realmGet$name != null) {
         Table.nativeSetString(tableNativePtr, columnInfo.nameIndex, rowIndex, realmGet$name);
       } else {
         Table.nativeSetNull(tableNativePtr, columnInfo.nameIndex, rowIndex);
       }
       Table.nativeSetLong(
           tableNativePtr,
           columnInfo.ageIndex,
           rowIndex,
           ((SimpleRealmProxyInterface) object).realmGet$age());
     }
   }
 }
コード例 #3
0
 public static long insertOrUpdate(
     Realm realm, some.test.Booleans object, Map<RealmModel, Long> cache) {
   Table table = realm.getTable(some.test.Booleans.class);
   long tableNativePtr = table.getNativeTablePointer();
   BooleansColumnInfo columnInfo =
       (BooleansColumnInfo) realm.schema.getColumnInfo(some.test.Booleans.class);
   long rowIndex = Table.nativeAddEmptyRow(tableNativePtr, 1);
   cache.put(object, rowIndex);
   Table.nativeSetBoolean(
       tableNativePtr,
       columnInfo.doneIndex,
       rowIndex,
       ((BooleansRealmProxyInterface) object).realmGet$done());
   Table.nativeSetBoolean(
       tableNativePtr,
       columnInfo.isReadyIndex,
       rowIndex,
       ((BooleansRealmProxyInterface) object).realmGet$isReady());
   Table.nativeSetBoolean(
       tableNativePtr,
       columnInfo.mCompletedIndex,
       rowIndex,
       ((BooleansRealmProxyInterface) object).realmGet$mCompleted());
   Table.nativeSetBoolean(
       tableNativePtr,
       columnInfo.anotherBooleanIndex,
       rowIndex,
       ((BooleansRealmProxyInterface) object).realmGet$anotherBoolean());
   return rowIndex;
 }
コード例 #4
0
 public static long insert(Realm realm, some.test.Simple object, Map<RealmModel, Long> cache) {
   Table table = realm.getTable(some.test.Simple.class);
   long tableNativePtr = table.getNativeTablePointer();
   SimpleColumnInfo columnInfo =
       (SimpleColumnInfo) realm.schema.getColumnInfo(some.test.Simple.class);
   long rowIndex = Table.nativeAddEmptyRow(tableNativePtr, 1);
   cache.put(object, rowIndex);
   String realmGet$name = ((SimpleRealmProxyInterface) object).realmGet$name();
   if (realmGet$name != null) {
     Table.nativeSetString(tableNativePtr, columnInfo.nameIndex, rowIndex, realmGet$name);
   }
   Table.nativeSetLong(
       tableNativePtr,
       columnInfo.ageIndex,
       rowIndex,
       ((SimpleRealmProxyInterface) object).realmGet$age());
   return rowIndex;
 }