Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 27, 2019 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryKuz/b683e45f3d35c17dfe4732d89295da34 to your computer and use it in GitHub Desktop.
Save MaryKuz/b683e45f3d35c17dfe4732d89295da34 to your computer and use it in GitHub Desktop.
Two classes: University and Student
public class Student extends RealmObject {
@PrimaryKey
private String id;
@Required
private String name;
@Required
private Date birthday;
@Required
private String email;
// getters and setters
}
public class University extends RealmObject {
@PrimaryKey
private String id;
@Required
private String name;
private RealmList students;
// getters and setters
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment