forked from neo4j-examples/movies-java-spring-data-neo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MovieRepository.java
25 lines (19 loc) · 869 Bytes
/
MovieRepository.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package movies.spring.data.neo4j.repositories;
import java.util.Collection;
import movies.spring.data.neo4j.domain.Movie;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
/**
* @author Michael Hunger
* @author Mark Angrish
* @author Michael J. Simons
*/
@RepositoryRestResource(collectionResourceRel = "movies", path = "movies")
public interface MovieRepository extends Neo4jRepository<Movie, Long> {
Movie findByTitle(@Param("title") String title);
Collection<Movie> findByTitleLike(@Param("title") String title);
@Query("MATCH (m:Movie)<-[r:ACTED_IN]-(a:Person) RETURN m,r,a LIMIT {limit}")
Collection<Movie> graph(@Param("limit") int limit);
}