Hey everyone!
Assume there are two node entities:
In my repository, I have a Query that gets all Accounts by a given Role:Code:public class Account extends BaseEntity { ... @Fetch @RelatedTo(type = "HAS_ROLE") private Set<Role> roles = Sets.newHashSet(); ... } public class Role extends BaseEntity { ... }
But this query doesn't work, when I use this method in my test case I get the following error:Code:public interface AccountRepository extends GraphRepository<Account> { @Query("START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account") Iterable<Account> findByRole(Role role);
As it seems, there is something wrong with my query, but I don't know what, and could't figure it out yet...Code:org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account; nested exception is expected string
Could anyone provide some help??
THANKS!


Reply With Quote
