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

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -