package n; import org.neo4j.ogm.config.Configuration; import org.neo4j.ogm.session.Session; import org.neo4j.ogm.session.SessionFactory; public class Neo4JSessionFactory { private final static Configuration graphOgmConfiguration = new Configuration.Builder() .uri("bolt://localhost:7687") .credentials("neo4j", "password") .build(); private final static SessionFactory graphSessionFactory = new SessionFactory(graphOgmConfiguration, "c.c1", "c.c2"); private Neo4JSessionFactory() { } public static Session createNeo4JSession() { return graphSessionFactory.openSession(); } }