android - parse : ParseObject One –to- Many Relationship -
android - parse : ParseObject One –to- Many Relationship -
i create table contain: subject_code
, subject_name
, subject_section
(fk).
a subject have few sections (eg.lecturer sec,tut 1 sec, tut 2 sec ) , need create subject_section
table.
i want link subject_section
table previous table subject_section
. how link using array or pointer in parse?
you create new parseclass "subject_section" pointer column "subject" , reference related subject it.
code example:
parsequery subjectquery = parsequery.getquery("subject"); subjectquery.whereequalto("subject_name", subjectname); subjectquery.getfirstinbackground(new getcallback<parseobject>() { public void done(parseobject object, parseexception e) { if (object == null) { // object not found } else { parseobject subjectsection = new parseobject("subjectsection"); subjectsection.put("subject", object); subjectsection.saveinbackground(); } } });
android arrays parse.com
Comments
Post a Comment