android - Implementing a SQLite Database with List<String> as Column type using ORMLite -
i have requirement need store list in column in database. serializing list might option, not sure if right one.
also, want avoid creating table store list elements , reference original table row.
i using ormlite database operations.
its concept of foreign collection.
you need create entity wraps string. looks like:
@databasetable public class pupil { @databasefield(generatedid = true) print int id; @databasefield private string fname; @databasefield private string lname; @databasefield(foreign = true) private address address; } address class have foreigncollection of these student. @databasetable public class address { @databasefield(generatedid = true) print int id; @foreigncollectionfield() private foreigncollection<student> student; }
also refer link , may help you.
android ormlite
No comments:
Post a Comment