2015-12-22 2 views
0

Как установить идентификаторы для моего объекта realm .. Мне нужно использовать его для запроса в моем втором действии в приложении для Android. Благодарю.Как установить идентификаторы для моего объекта realm?

Школа объекта:

public class School extends RealmObject { 

@Required 
private String SchoolID; 
private String SchoolName; 
private RealmList<Student> Students; 


getters/setters 

public RealmList<Student> getStudents() { 
    return Students; 
} 

public void setStudents(RealmList<Student> students) { 
    Students = students; 
} 

Студент Объект:

public class Student extends RealmObject{ 

@Required 
private String StudentID; 
private String StudentName; 

getters/setters 

} 
+0

ли вы имеете в виду первичный ключ с помощью идентификаторов? –

+0

Я не уверен ... Мне нужно использовать его для извлечения данных из моего объекта realm. http://stackoverflow.com/questions/34329224/how-to-get-the-realm-information-from-an-second-activity?noredirect1_comment56522810_34329224 Он также относится к https://github.com/ realm/realm-java/issues/567 – Spidey

+0

'@PrimaryKey private String SchoolID;' – EpicPandaForce

ответ