In ActiveAndroid, I can build relationships by directly referencing the POJO. For instance, if House
had many Window
s, this would be fairly straightforward.
Rather than using this direct reference, is there a way to manually set the foreign key and still be able to ActiveAndroid Select
later on?
The reason for this is that we are performing data syncing from the server to Android. The data comes in JSON, but rather than being nested the data already comes with foreign keys. I would like to set the foreign keys to our data models without diving too deep into SQLite code.
UPDATE to @ssh's answer:
I am not trying to dynamically change the database structure. Rather, I would like to manually set the foreign key of my models. My assumption is that ActiveAndroid wraps around foreign key queries to directly access other objects that are defined as attributes. Is there a way to access that foreign key table directly?
Thanks for the current answer - I'll look more into setting that value in the foreign key column directly using SQLite.