java - Is it possible to partially subclass a ParseObject? -
the parse sdk documentation points out how subclass object:
// armor.java @parseclassname("armor") public class armor extends parseobject { public string getdisplayname() { return getstring("displayname"); } public void setdisplayname(string value) { put("displayname", value); } }
but if wanted get/set parts of parse object? storing member information in parse in parseuser table. each user has name, email address, number of times they've done app, , possibly later on, personal information billing info, address, etc. storing storing user names in separate sql database, able store them in local datastore, if possible. problem see, since information not encrypted in datastore (i can view contents using sqlite browser), not want store personal info on device.
if create parseobject called, "members", there way can fetch username/objectid each user, , not retrieve/touch other details?
if not possible, suppose can still use sqlite, maintaining 2 databases not optimal. i'm thinking following:
// member.java @parseclassname("_user") public class member extends parseobject { public string getmembername() { return getstring("username"); } public void setmembername(string value) { put("username", value); } }
you create 2 separate parseobject
subclasses: "member" , "user". each "member" object has "user" object associated (and possibly vice versa). allows flexibility retrieve list of "user"s if that's need.
of course, nothing preventing calling getters information need , ignoring others. potential solution.
Comments
Post a Comment