use of org.neo4j.ogm.domain.travel.Visit in project neo4j-ogm by neo4j.
the class CompilerTest method shouldMergeNewRelationshipEntity.
@Test
public void shouldMergeNewRelationshipEntity() throws Exception {
Person frantisek = new Person("Frantisek");
Place scotland = new Place("Scotland");
Visit visit = frantisek.addVisit(scotland, "Holiday");
Compiler compiler = mapAndCompile(frantisek, -1);
List<Statement> statements = compiler.createRelationshipsStatements();
assertThat(statements).extracting(Statement::getStatement).containsOnly("UNWIND $rows as row " + "MATCH (startNode) WHERE ID(startNode) = row.startNodeId WITH row,startNode " + "MATCH (endNode) WHERE ID(endNode) = row.endNodeId " + "MERGE (startNode)-[rel:`VISITED` {`identifier`: row.props.`identifier`}]->(endNode) " + "SET rel += row.props " + "RETURN row.relRef as ref, ID(rel) as id, $type as type");
}