package uk.ac.ebi.biosamples.neo.repo;

import java.util.HashMap;
import java.util.Map;

import org.neo4j.ogm.session.Session;

import uk.ac.ebi.biosamples.neo.model.NeoSample;

public class NeoSampleRepositoryImpl implements NeoSampleRepositoryCustom {


	private Session session;
	
	public NeoSampleRepositoryImpl(Session session) {
		this.session = session;
	}
	
	@Override
	public NeoSample insertNew(NeoSample sample) {
		String cypher = "CREATE (s:Sample {accession:$accession}) RETURN s";
		Map<String,String> parameters = new HashMap<>();
		parameters.put("accession", sample.getAccession());
		return session.queryForObject(NeoSample.class, cypher, parameters);
	}

}

@@ -469,18 +469,30 @@
 ion:
-$a
+'%22+sample.getA
 ccession
 %7D) R
@@ -487,16 +487,21 @@
 ccession
+()+%22'
 %7D) RETUR
@@ -559,16 +559,18 @@
 %3C%3E();%0A%09%09
+//
 paramete

tweak to fix neo4j cypher parameters