realm

Speed of search operation in a Realm database

我的梦境 提交于 2019-12-02 07:36:17
问题 This is the model for my RealmObject class : public class ARDatabase extends RealmObject { @PrimaryKey private String uid; private String namex; private String desc; private boolean isVideo; private boolean isDeleted; private String urlImg; private String urlApp; private int updates; private boolean isDownloaded; private String location; public ARDatabase(){} public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getNamex() { return namex; }

How to correctly configure path for the Realm DB-file (<db_name>.realm) in iOS project?

二次信任 提交于 2019-12-02 07:22:06
Sorry for my english. I have developed a mobile application that needs its own local data store. I chose Realm as the database management system. In the process of studying the Realm documentation I had no problems with the database design, it's normalization, the CRUD-operations and everything that is related directly to the code. I was confused following. I test my application in the simulator. I did not create the local database. I’ve just done it as it is written in the documentation of Realm. Realm created by itself its database and I did not specify any settings. The location of my file

Realm data sync not consistent

╄→гoц情女王★ 提交于 2019-12-02 05:58:08
I am having an issue where Realm sometimes returns me different data every time I do the same query. Currently I am using an SyncAdapter for uploading. The idea is that we are trying to implement offline mode. So when the User creates an item it get's added to Realm db. I am generating the ID for that item manually by getting the maxId and adding 1000 to it. After that I am sending the itemID to the UploadSyncAdapter where I get the itemById and send it to the backend and the backend returns me the item with the real ID. So after that I delete the old item and just insert the new item into

FindFirst returns null

廉价感情. 提交于 2019-12-02 05:43:38
问题 I'm using Realm to provide the database for my application. But... After login, the server returns the data and I create the account (of AccountManager) and save these datas at the database of the application, like this (at an AsyncTask, of course): UserRealm userRealm = new UserRealm(); //setter of the userRealm... Realm realm = Realm.getInstance(context); realm.beginTransaction(); realm.copyToRealmOrUpdate(userRealm); realm.commitTransaction(); realm.close(); After, I close the

Realm not auto-deleting database if migration needed

不想你离开。 提交于 2019-12-02 05:24:46
问题 We are in development and db schema changes occur often. Since we are not live, migrations are not needed. I therefor configured Realm as follows: RealmConfiguration config = new RealmConfiguration.Builder(context) .name("jt.realm") .schemaVersion(1) .deleteRealmIfMigrationNeeded() // todo remove for production .build(); Realm.setDefaultConfiguration(config); However, when the schema is changed, an exception is thrown: RealmMigration must be provided My understanding from the docs are that

Objectmapper get array of one item within JSON

微笑、不失礼 提交于 2019-12-02 04:28:24
So I have the following JSON, which I am using together with ObjectMapper and Realm. { "result": [ { "id": 20, "types": [ "now" ], "url": "/nl/whereto/ezrhgerigerg", "categories": [ { "id": 39, "name": "Food " }, { "id": 21, "name": "Varia" } ] }, My problem is getting the data from "types", which for some items in the array says "now" or "later", and is empty for other items (hence, no types item is given). I tried to do the following in my mapping: class Publication: Object, Mappable { dynamic var id:Int = 0 var typez = List<getType>() dynamic var url:String? required convenience init?(_ map

dyld: Symbol not found: __TMPdCSs12AnyGenerator

…衆ロ難τιáo~ 提交于 2019-12-02 03:49:37
问题 when I try to build and Run my project it gives me an error of symbol not found: __TMPdCSs12AnyGenerator I had installed Xcode 7 beta on my system. When I installed it gives me an error of realm module not found so I just removed realm framework and added again after adding this frameworks again it gives about stated error. 回答1: I have encountered this problem after I update my XCode from 7.2 to 7.3. I use a framework build from XCode7.2. After I rebuild the framework on XCode7.3, the problem

Realm returns empty list of object

﹥>﹥吖頭↗ 提交于 2019-12-02 03:41:50
I want to fetch CropDataList from Farmer Object. when i fetch Farmer Object it's not null, but the cropData list associated with Farmer Object returns empty. I can see database entry via Stetho and there list has one entry. Here's my code. public class Farmer extends RealmObject { @PrimaryKey private String id; private RealmList<CropData> cropData; public String getId() { return id; } public void setId(String id) { this.id = id; } public RealmList<CropData> getCropData() { return cropData; } public void setCropData(RealmList<CropData> cropData) { this.cropData = cropData; } public static class

Speed of search operation in a Realm database

左心房为你撑大大i 提交于 2019-12-02 03:28:05
This is the model for my RealmObject class : public class ARDatabase extends RealmObject { @PrimaryKey private String uid; private String namex; private String desc; private boolean isVideo; private boolean isDeleted; private String urlImg; private String urlApp; private int updates; private boolean isDownloaded; private String location; public ARDatabase(){} public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getNamex() { return namex; } public void setNamex(String namex) { this.namex = namex; } public String getDesc() { return desc; }

FindFirst returns null

天涯浪子 提交于 2019-12-02 02:48:33
I'm using Realm to provide the database for my application. But... After login, the server returns the data and I create the account (of AccountManager) and save these datas at the database of the application, like this (at an AsyncTask, of course): UserRealm userRealm = new UserRealm(); //setter of the userRealm... Realm realm = Realm.getInstance(context); realm.beginTransaction(); realm.copyToRealmOrUpdate(userRealm); realm.commitTransaction(); realm.close(); After, I close the LoginActivity and at the onResume of the MainActivity, I try to load the user, like this(at an AsyncTask, again...)