Is there page support for custom queries in SDN4?
- If so, how does it work?
- If not, is there a desktop?
I have the following Spring Data Neo4j 4 repository:
@Repository public interface TopicRepository extends GraphRepository<Topic>,IAuthorityLookup {
And the corresponding test file:
@Test public void itShouldReturnAllOfficersAsAPage() { Pageable pageable = new PageRequest(1,10); Page<User> officers = topicRepository.topicOfficers(1L, pageable); assertNotNull(officers); }
When I run the test, I encounter the following exception
Failed to convert from type java.util.ArrayList<?> to type org.springframework.data.domain.Page<?> for value '[ org.lecture.model.User@1 ]'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type java.util.ArrayList<?> to type org.springframework.data.domain.Page<?>
This is my setup:
dependencies { //other dependencies omitted compile("org.neo4j:neo4j-cypher-dsl:2.0.1") compile "org.neo4j.app:neo4j-server:2.2.2" compile(group: 'org.springframework.data', name: 'spring-data-neo4j', version: '4.0.0.BUILD-SNAPSHOT') compile(group: 'org.springframework.data', name: 'spring-data-neo4j', version: '4.0.0.BUILD-SNAPSHOT', classifier: 'tests') testCompile(group: 'org.neo4j', name: 'neo4j-kernel', version: '2.2.2', classifier: 'tests') testCompile(group: 'org.neo4j.app', name: 'neo4j-server', version: '2.2.2', classifier: 'tests') testCompile(group: 'org.neo4j', name: 'neo4j-io', version: '2.2.2', classifier: 'tests') }
The snapshot used allows you to handle pagination, since the following test is simple:
@Test public void itShouldReturnAllTopicsAsAPage() { Pageable pageable = new PageRequest(1,10); Page<Topic> topics = topicRepository.findAll(pageable); assertNotNull(topics); }
java spring neo4j spring-data-neo4j-4
ShrimpPhaser
source share