I have a class which I want to persist with OrmLite and it stores most of its data in a HashMap. I want to map these fields to the table in Sqlite, leaving the ones absent in the map as null. Is it possible to override methods to save some record to the database with custom implementations using OrmLite?
I have a class which I want to persist with OrmLite and it stores
Share
I think roddik has moved on but I thought I’d post an answer anyway as the author of OrmLite.
My general response is that it would be better to create an object to store the columns instead of a Map. Although SQL is a row of string columns, the whole point of ORM is that we can deal with the rows as objects in Java instead of a Map of strings.
Right now there is not a way to persist a Map of strings in ORMLite.