I am taking data from REST API in the form of JSON.
Using http://www.jsonschema2pojo.org/, created classes. Using GSON I am converting data to POJOs. Objects (tons of them) are in the form of hierarchial tree: parent includes children which can be
I have tried to use different ORMs: SugarORM, RushORM, SquiDB, JDXA. Some of them do not support relations (one to one, one to many, many to many). Some of them requires to add annotations. JDXA is good, but it is paid and mapping configuration took a while, it seemed to me too complex.
This question may seem as asking for library recomendation or "which tool to use", but really I am not seeing the way how to solve this problem.
How to save these POJOs into SQLite relational tables and get them back when needed in efficient way(in less time)? Should I use ORM? or I should write inserting and selecting code myself?
If speed is your main concern writing your own queries will be the most efficient as all these libraries have overhead logic to make them generic.
I always would use a ORM because of the development time it saves and the speed difference will not be huge. I'd only worry about a ORM being too slow if you are loading/saving 5000+ objects regularly. This is based on benchmarking done when writing RushOrm.