{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/3850","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/3850/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/3850/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/3850/events","html_url":"https://github.com/realm/realm-java/issues/3850","id":191964600,"number":3850,"title":"Unable to enter values into table","user":{"login":"Sutirth","id":3212997,"avatar_url":"https://avatars.githubusercontent.com/u/3212997?v=3","gravatar_id":"","url":"https://api.github.com/users/Sutirth","html_url":"https://github.com/Sutirth","followers_url":"https://api.github.com/users/Sutirth/followers","following_url":"https://api.github.com/users/Sutirth/following{/other_user}","gists_url":"https://api.github.com/users/Sutirth/gists{/gist_id}","starred_url":"https://api.github.com/users/Sutirth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sutirth/subscriptions","organizations_url":"https://api.github.com/users/Sutirth/orgs","repos_url":"https://api.github.com/users/Sutirth/repos","events_url":"https://api.github.com/users/Sutirth/events{/privacy}","received_events_url":"https://api.github.com/users/Sutirth/received_events","type":"User","site_admin":false},"labels":[{"id":200279932,"url":"https://api.github.com/repos/realm/realm-java/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed","default":false},{"id":3545600,"url":"https://api.github.com/repos/realm/realm-java/labels/T:Help","name":"T:Help","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-11-28T10:06:48Z","updated_at":"2016-11-30T11:18:23Z","closed_at":null,"body":"\r\n#### Goal\r\n\r\nTo Enter Values in Tables\r\n\r\n#### Expected Results\r\n\r\nDatabase should contain the value\r\n\r\n#### Actual Results\r\n\r\nDatabase does not renders correct value\r\n\r\n#### Steps & Code to Reproduce\r\n\r\nUsed accessor method to see the values entered in Database. The values are entered correctly but when taken the realm file out to view in realm browser the values entered are 0.\r\n\r\n#### Code Sample\r\n\r\n      for (int j = 0; j < syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().size(); j++) {\r\n    \r\n                                                        SweatPointFitnessDB sweatPointFitnessDB = realm.where(SweatPointFitnessDB.class)\r\n                                                                .equalTo(\"forday\", syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getDate())\r\n                                                                .findFirst();\r\n    \r\n                                                        String dateSplit[] = syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getDate().split(\"-\");\r\n                                                        currentMonthNo = dateSplit[1];\r\n                                                        Calendar currentTime = Calendar.getInstance();\r\n                                                        currentTime.set(Calendar.MONTH, Integer.valueOf(dateSplit[1]) - 1);\r\n                                                        currentMonth = nameFormat.format(currentTime.getTime()).toString();\r\n    \r\n    \r\n    \r\n    \r\n                                                        if (sweatPointFitnessDB == null) {\r\n    \r\n                                                            sweatPointFitnessDB = realm.createObject(SweatPointFitnessDB.class, syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getDate());\r\n    \r\n                                                        }\r\n    \r\n    \r\n                                                        sweatPointFitnessDB.setGoalSweatPoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getGoalProgressSweatPoints());\r\n                                                        sweatPointFitnessDB.setBadgeSweatPoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getBadgeSweatPoints());\r\n                                                        sweatPointFitnessDB.setSweatpoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getFitnessSweatPoints());\r\n                                                        sweatPointFitnessDB.setRewardSweatPoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getRewardSweatPoints());\r\n                                                        sweatPointFitnessDB.setBonusSweatPoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getBonusSweatPoints());\r\n                                                        sweatPointFitnessDB.setDayTotalSweatPoints(syncApiModel.getData().get(entityNum).getSweatPoints().getUpdate().get(j).getDayTotalSweatPoints());\r\n                                                        sweatPointFitnessDB.setCurrentMonth(currentMonth);\r\n                                                        sweatPointFitnessDB.setCurrentMonthNo(currentMonthNo);\r\n                                                        realm.copyToRealmOrUpdate(sweatPointFitnessDB);\r\n    \r\n                                                        Log.i(TAG,\"SP DAY: \"+sweatPointFitnessDB.getForday());\r\n                                                        Log.i(TAG,\"SP TOTAL: \"+sweatPointFitnessDB.getDayTotalSweatPoints());\r\n    \r\n    \r\n                                                    }\r\n\r\nP.S Uploading 2 screenshot 1st) Android studio console,  2nd) Realm Browser\r\n<img width=\"811\" alt=\"screenshot 2016-11-28 15 16 22\" src=\"https://cloud.githubusercontent.com/assets/3212997/20664209/37132234-b580-11e6-9fc5-54e299af75ac.png\">\r\n<img width=\"1206\" alt=\"screenshot 2016-11-28 15 18 28\" src=\"https://cloud.githubusercontent.com/assets/3212997/20664216/401ebbc2-b580-11e6-9c5e-2993a2632a76.png\">\r\n\r\n\r\n\r\n\r\n\r\n#### Version of Realm and tooling\r\nRealm version(s): io.realm:realm-gradle-plugin:2.1.1\r\n\r\nRealm sync feature enabled:no\r\n\r\nAndroid Studio version: 2.2\r\n\r\nWhich Android version and device: Nexus 6p\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/263849005","html_url":"https://github.com/realm/realm-java/issues/3850#issuecomment-263849005","issue_url":"https://api.github.com/repos/realm/realm-java/issues/3850","id":263849005,"user":{"login":"Sutirth","id":3212997,"avatar_url":"https://avatars.githubusercontent.com/u/3212997?v=3","gravatar_id":"","url":"https://api.github.com/users/Sutirth","html_url":"https://github.com/Sutirth","followers_url":"https://api.github.com/users/Sutirth/followers","following_url":"https://api.github.com/users/Sutirth/following{/other_user}","gists_url":"https://api.github.com/users/Sutirth/gists{/gist_id}","starred_url":"https://api.github.com/users/Sutirth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sutirth/subscriptions","organizations_url":"https://api.github.com/users/Sutirth/orgs","repos_url":"https://api.github.com/users/Sutirth/repos","events_url":"https://api.github.com/users/Sutirth/events{/privacy}","received_events_url":"https://api.github.com/users/Sutirth/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T11:18:23Z","updated_at":"2016-11-30T11:18:23Z","body":"@zaki50  You mean write code in migration file for e.g\r\n\r\n    if (oldVersion == 23) {\r\n                RealmObjectSchema sweatPointFitnessDBSchema = schema.get(\"SweatPointFitnessDB\")\r\n                        .addField(\"dayTotalSweatPoints\", int.class);\r\n    \r\n    \r\n                oldVersion++;\r\n            }\r\n\r\nHard code some values here??"}}
{"actor":{"display_login":"Sutirth"}}