DATAGRAPH-443 Fix @Param annotation for derived finder methods (Add tests)

This commit is contained in:
Michael Hunger
2015-03-15 01:12:17 +01:00
parent 57bd64393e
commit 58ba8b2c51
2 changed files with 8 additions and 0 deletions

View File

@@ -107,6 +107,8 @@ public interface PersonRepository extends GraphRepository<Person>, NamedIndexRep
Iterable<Person> findByAge(int age);
Iterable<Person> findByAlias(@Param("alias") String alias);
@Query("start person=node:`name-index`('name:*') return person.name as name, person order by name asc ")
Iterable<NameAndPersonResult> getAllNamesAndPeople();

View File

@@ -465,6 +465,12 @@ public class GraphRepositoryTests {
assertThat(findByName, hasItem(michael));
}
@Test @Transactional
public void findByAlias() {
Iterable<Person> findByName = personRepository.findByAlias(testTeam.michael.getAlias());
assertThat(findByName, hasItem(testTeam.michael));
}
@Test @Transactional
public void countByName() {
Long num = personRepository.countByName(testTeam.michael.getName());