Last active
August 28, 2015 10:45
-
-
Save atetc/44d485795b4384126f9d to your computer and use it in GitHub Desktop.
save inner to DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SQLiteObject("templates") | |
public class OkSettings { | |
@SuppressWarnings("unused") | |
@SQLitePk | |
private long mId; | |
@SQLiteColumn(Column.BASE_URL) | |
@SerializedName("templatesBaseUrl") | |
private String mBaseUrl; | |
@SerializedName("templateCategories") | |
private List<TemplateCategory> mCategories = new ArrayList<>(); | |
public String getBaseUrl() { | |
return mBaseUrl; | |
} | |
public List<TemplateCategory> getCategories() { | |
return mCategories; | |
} | |
interface Column { | |
String BASE_URL = "base_url"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SQLiteObject("categories") | |
public class TemplateCategory { | |
@SuppressWarnings("unused") | |
@SQLitePk | |
private long mId; | |
@SQLiteColumn(Column.ID) | |
@SerializedName("id") | |
private String mName; | |
public TemplateCategory() { | |
} | |
interface Column { | |
String ID = "name"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final List<TemplateCategory> categories = okSettings.getCategories(); | |
SQLite.save(categories); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment