On Mon, May 12, 2014 at 05:32:05PM +0200, Sascha Lüdecke wrote: > I have not found any useable OR mapper for CBLite, am I missing something?
I believe this is the most recent discussion on this topic: https://groups.google.com/d/topic/mobile-couchbase/QmkamYMKwNU/discussion My understanding is that the situation is the same now (i.e., there is no supported ORM). The Couchbase folks would have to jump in about where it might be in the roadmap. > How do you work with data, do you all use the getProperties()->copy->edit- > >putProperties() approach as seen below to set individual properties? > > Map<String, Object> curProperties = document.getProperties(); > Map<String, Object> newProperties = new HashMap<String, Object>(); > newProperties.putAll(curProperties); > boolean checked = ((Boolean) newProperties.get("check")).booleanValue(); > newProperties.put("check", !checked); > document.putProperties(newProperties); I'm using what CBL gives you natively for saving changes, yeah. For new docs, I do something similar to your code (but in that case there's no map copying: just fill map->save). For updating documents, I use Document.update() instead: it streamlines handling update conflicts, and lets you bail on making the update if you see another change that obsoletes it came in first. In my experience using CBL without an ORM isn't too much of a pain, but - our app has been designed around that, and - our data model has changed enough over time that we have ORM-unfriendly warts to handle anyway. I totally understand the case for one though. -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/20140512220504.GA1031%40mqmb.local. For more options, visit https://groups.google.com/d/optout.
