use of org.neo4j.ogm.domain.hierarchy.relations.BaseEntity in project neo4j-ogm by neo4j.
the class HierarchyRelsTest method saveMultipleRelationshipsToBase.
// GH-152
@Test
public void saveMultipleRelationshipsToBase() {
Type1 node1 = new Type1();
node1.name = "type1";
Type2 node2 = new Type2();
node2.name = "type2";
node1.addIncoming(node2);
node2.addIncoming(node1);
Transaction transaction = session.beginTransaction();
session.save(node1);
transaction.commit();
transaction.close();
session.clear();
transaction = session.beginTransaction();
BaseEntity entity = session.load(BaseEntity.class, node1.getGraphId());
transaction.close();
assertThat(entity.getIncoming()).hasSize(1);
assertThat(entity.getOutgoing()).hasSize(1);
assertThat(node2.getGraphId()).isEqualTo(entity.getIncoming().get(0).getGraphId());
assertThat(node2.getGraphId()).isEqualTo(entity.getOutgoing().get(0).getGraphId());
}
Aggregations