Your lookup is wrong. You are passing in your uuid string, but instead you want
to do an index lookup
> @Query("""START player=node:Player(playerId={0})
So you are just retrieving the player and for the other 3 relationships you're
actually just checking that the exist?
Then probably move them into the WHERE part, or did you just not return them
here, b/c you were testing?
Also your variable length starting at 0 will return the player himself as
friend, mutedby etc.
Am 04.02.2014 um 23:58 schrieb Bytor99999 <[email protected]>:
> So I was trying to write a single query that can populate a Node with all of
> its related nodes, via 4 different relationship types into one domain object
> with Collections for each relationship.
>
> Here is the Cypher query that I have written
>
> @Query("""START player=node({0})
> MATCH (player)<-[:playerInvited*0..1]-(invitedBy),
> (player)<-[:playerDeclined*0..1]-(declinedBy),
> (player)<-[:playerMuted*0..1]-(mutedBy),
> (player)<-[:playerActive*0..1]-(friends)
> RETURN player""")
> public PlayerPresenceGraph getPlayerWithAllFriends(String playerID)
>
> And I get the following error
>
> 2014-02-04 14:35:09,451 ERROR com.hdpoker.data.actionhandlers.AbstractHandler
> - Unable to Handler request through Handler
> org.springframework.data.redis.RedisSystemException: Unknown jedis exception;
> nested exception is org.neo4j.rest.graphdb.RestResultException: Expected a
> propertycontainer or number here, but got:
> 1eb7f292-b67d-46e6-a38f-16f194bb61c8 at
> BadInputException
>
> org.neo4j.server.rest.repr.RepresentationExceptionHandlingIterable.exceptionOnHasNext(RepresentationExceptionHandlingIterable.java:50)
>
> org.neo4j.helpers.collection.ExceptionHandlingIterable$1.hasNext(ExceptionHandlingIterable.java:60)
>
> org.neo4j.helpers.collection.IteratorWrapper.hasNext(IteratorWrapper.java:42)
>
> org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:58)
> org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)
>
> I know I have something wrong in the query, but can't figure out what it is.
> I haven't been able to find an example that tries to retrieve 4 different
> collections. In other code, I tried
>
> PlayerPresenceGraph playerPresenceGraph =
> playerPresenceGraphRepository.findByPlayerID(playerID)
> if (playerPresenceGraph) {
> neo4jTemplate.fetch(playerPresenceGraph.getInvited())
> neo4jTemplate.fetch(playerPresenceGraph.getDeclined())
> neo4jTemplate.fetch(playerPresenceGraph.getMuted())
> neo4jTemplate.fetch(playerPresenceGraph.getInviteToTable())
>
> And that works, but we have noticed that Neo4J ends up taking 200% CPU usage
> for the query and it is slow. We need this really fast, one player and all
> their invitedFriends, declinedFriends, muted players and actual Friends in
> one query that is really fast.
>
> Thanks
>
> Mark
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.