strongloop-community / loopback-sdk-android

Android Client SDK for the LoopBack framework.
Other
67 stars 41 forks source link

Model (PersistedModel) should implement all DAO methods #57

Open bajtos opened 9 years ago

bajtos commented 9 years ago

At the moment, the ModelRepository class implements only a subset of methods provided by PersistedModel on the server.

Most notably it is not possible to execute find with a custom filter.

We should improve ModelRepository and include all built-in methods OOTB.

Related: https://groups.google.com/forum/#!topic/loopbackjs/1xHq5vFRayk

jlgallego commented 9 years ago

I am facing the same problem. I'd like that implemented too. It is possible to execute find filtering on just one field though, but I can not seem to find a proper way of expressing a filter on more than one field, joined with AND, for example.

bajtos commented 9 years ago

@jlgallego would you mind contributing this improvement yourself?

ageneau commented 9 years ago

I have these methods implemented in the "fix_flatten" branch in my repository (https://github.com/ageneau/loopback-sdk-android). I haven't had time to rebase it on the latest changes yet. The "find" and "findOne" methods now take optional parameters.

jlgallego commented 9 years ago

Unfortunately, I don't feel I have the time for it right now. Anyway I think @ageneau 's work is worth a look & test.

afaucogney commented 9 years ago

Does anyone @bajtos or @jlgallego had a look on @ageneau job ? more an more people request this feature that decrease Loopback capabilities by this lack. I'm volunteer to help, but unfortunately not skilled enough to just do it.

Rajan commented 9 years ago

@afaucogney I'm using @ageneau 's find() method and it works with 'filter'. If you wish to get started with solving this, I recommend to debug RestAdapter and com.strongloop.android.remoting.adapters.RestAdapter class. It constructs URL in the end which gets posted to the server. I'm happy to help/contribute.