anchor.diff:  ==== Spring Data Neo4j Repositories
   Spring Data includes repository support for Neo4j.
   
  -In fact, both Spring Data JPA and Spring Data Neo4j share the same common infrastructure.
  -You could take the JPA example from earlier and, assuming that `City` is now a Neo4j OGM
  -`@NodeEntity` rather than a JPA `@Entity`, it works in the same way.
  -
  -TIP: You can customize entity scanning locations by using the `@EntityScan` annotation.
  -
  -To enable repository support (and optionally support for `@Transactional`), add the
  -following two annotations to your Spring configuration:
  -
  -[source,java,indent=0]
  -----
  -	@EnableNeo4jRepositories(basePackages = "com.example.myapp.repository")
  -	@EnableTransactionManagement
  -----
  -
  -==== Repository Example
  -
  -The following example shows an interface definition for a Neo4j repository:
  +Spring Data Neo4j shares the common infrastructure with Spring Data JPA as many other
  +Spring Data modules do. You could take the JPA example from earlier and define
  +`City` as Neo4j OGM `@NodeEntity` rather than JPA `@Entity` and the repository
  +abstraction works in the same way, as shown in the following example:
   
   [source,java,indent=0]
   ----
   	package com.example.myapp.domain;
   
  -	import org.springframework.data.domain.*;
  -	import org.springframework.data.repository.*;
  -
  -	public interface CityRepository extends GraphRepository<City> {
  -
  -		Page<City> findAll(Pageable pageable);
  -
  -		City findByNameAndCountry(String name, String country);
  -
  -	}
  -----
  -
  -TIP: For complete details of Spring Data Neo4j, including its rich object mapping
  -technologies, refer to the https://projects.spring.io/spring-data-neo4j/[reference
  -documentation].
  +	import java.util.Optional;
  +
  +	import org.springframework.data.neo4j.repository.*;
  +
  +	public interface CityRepository extends Neo4jRepository<City, Long> {
  +
  +		Optional<City> findOneByNameAndState(String name, String state);
  +
  +	}
  +----
  +
  +The `spring-boot-starter-data-neo4j` "`Starter`" enables the repository support as well 
  +as transaction management. You can customize the locations to look for repositories and
  +entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a 
  +`@Configuration`-bean.
  +
  +TIP: For complete details of Spring Data Neo4j, including its object mapping
  +technologies, refer to the https://projects.spring.io/spring-data-neo4j/[project page] and
  +the reference documentation.
   
   
   
  
positive.code: 
  		Page<City> findAll(Pageable pageable);
  
  		City findByNameAndCountryAllIgnoringCase(String name, String country);
  
  	}
  ----
  
negative.code: 
  If you add `org.neo4j:neo4j-ogm-embedded-driver` to the dependencies of your application,
  Spring Boot automatically configures an in-process embedded instance of Neo4j that does
  not persist any data when your application shuts down. 
  
  [NOTE]
  ====
  As the embedded Neo4j OGM  driver  does not provide the Neo4j kernel itself, you have 
  to declare `org.neo4j:neo4j` as dependency yourself. Refer to 
  https://neo4j.com/docs/ogm-manual/current/reference/#reference:getting-started[the
  Neo4j OGM documentation] for list of compatible versions.
  ====
  
  The embedded driver takes precedence over the other drivers when there are multiple
  drivers on the classpath. You can explicitly disable the embedded mode by setting 
  `spring.data.neo4j.embedded.enabled=false`. 
  
  <<boot-features-testing-spring-boot-applications-testing-autoconfigured-neo4j-test,Data Neo4j Tests>>
  automatically make use of an embedded Neo4j instance if the embedded driver and Neo4j
  kernel are on the classpath as described above.
  
  [NOTE]
  ====
  You can enable persistence for the embedded mode by providing a path to a database file 
  in your configuration like this: `spring.data.neo4j.uri=file://var/tmp/graph.db`.
  ====
  
  
  
  [[boot-features-neo4j-ogm-session]]
  