2

Is it possible to set ID of certain record? I'm importing multi table database into my application database, that is mapped to ActiveAndroid model. I get it over http in json. It would save a lot of work to preserver those server-side ids on records to have same relations id<>id as on the server.

I planned on deserialisating json to objects using gson and then to save them using activeandroid .save()

Or what is the simplest way to accomplish something like that. Get rid of the the json and do some SQL import?

Lubos Horacek
  • 1,562
  • 10
  • 28
  • You can, but beware that this will be an issue if you create a locale object that does not exist on the server. – njzk2 Nov 06 '13 at 22:57
  • And how, getId is final and there is no setter for mId field. I think I will give SugarORM a try – Lubos Horacek Nov 07 '13 at 00:12
  • Hey @LubosHoracek, did you end up giving SugarORM a go? I'm at a similar spot as you with Active Android. – Joshua Pinter Dec 10 '13 at 00:26
  • As I wrote in comment below I ended up executing direct SQLs when importing. But I'm at the same spot now and turning towards SugarORM as this is critical feature. – Lubos Horacek Dec 08 '14 at 04:25

1 Answers1

0

Not possible. Importing data is to be done by calling SQL inserts directly.

Lubos Horacek
  • 1,562
  • 10
  • 28