We ave modelled our business classes as follows :-
We are trying to fetch Student associated with a school and vice-versa but unable to do so.
We have a School and Student node with directed outgoing relation (IS_STUDENT_OF) from school to student with a relationship property fulltime:yes
Model code for School,student and RelationshipEntity
@NodeEntity(label = "STUDENT")
public class Student {
@Id
Long id;
@Property
String name;
@Relationship(type = "IS_STUDENT_OF", direction = Relationship.UNDIRECTED)
@JsonIgnoreProperties("student")
SchoolStudentRelationEntity schoolStudentRelationEntity;
}
@NodeEntity(label = "SCHOOL")
public class School {
@Id
Long id;
@Property
String schoolName;
@Relationship(type = "IS_STUDENT_OF", direction = Relationship.UNDIRECTED)
@JsonIgnoreProperties("school")
SchoolStudentRelationEntity schoolStudentRelationEntity;
}
@RelationshipEntity(type="IS_STUDENT_OF")
public class SchoolStudentRelationEntity {
@Property (name ="FULLTIME")
String fullTime;
@StartNode
School school;
@EndNode
Set<Student> student;
}