private StatementResult employ ( final Transaction tx , final String person , final String company ) { return tx . run ( "MATCH (person:Person {name: $person_name}) " + "MATCH (company:Company {name: $company_name}) " + "CREATE (person)-[:WORKS_FOR]->(company)" , parameters ( "person_name" , person , "company_name" , company ) ) ; }
This relies on the person first having been created .