Closed spring-projects-issues closed 6 years ago
Luanne Misquitta commented
Hi Greg, is there a reason why there's an underscore in findByParent_Name (instead of findByParentName)?
Greg Guydo commented
I pulled this format from the docs - and it was necessary in my case since I do have a field parentName on entity that is transient.
http://docs.spring.io/spring-data/data-commons/docs/1.8.0.RELEASE/reference/html/repositories.html Section 1.2.2 Heading Property Expressions
Luanne Misquitta commented
Unfortunately that is not supported yet. Leaving this issue open
Mark Paluch commented
Similar issue for me. I'm trying to query a property name of related entities.
Code
@NodeEntity
public class Person {
@GraphId
private Long id;
private String name;
@Relationship(type="TEAMMATE")
public Set<Person> teammates;
// ...
}
public interface PersonRepository extends GraphRepository<Person> {
List<Person> findByTeammatesName(String name);
}
Exception
Caused by: org.neo4j.kernel.impl.query.QueryExecutionKernelException: m0 not defined (line 1, column 26 (offset: 25))
"MATCH (n:`Person`) WHERE m0.`name` = { `teammates_name` } MATCH (n)-[:`TEAMMATE`]-(m0) WITH n MATCH p=(n)-[*0..1]-(m) RETURN p, ID(n)"
Greg Guydo opened DATAGRAPH-681 and commented
Given the following node:
and the following repository method
the OGM framework VariableDepthQuery generates the following query:
which throws an error "m0 not defined"
Affects: 4.0 M1, 4.0 RC1
1 votes, 3 watchers