Could you annotate the field with a query instead? Like:

@Query("MATCH {self}-[p:PRIZES]-(prize:Prize) RETURN prize ORDER BY p.order 
ASC ")? 
Set<Prize> prizes;

I note from the documentation that the older format is still used, so maybe 
it should be:

@Query("START s=node({self}) MATCH (s)-[p:PRIZES]-(prize:Prize) RETURN 
prize ORDER BY p.order ASC ")? 
Set<Prize> prizes;

M

On Friday, 26 September 2014 17:21:00 UTC+1, KP Low wrote:
>
> Hi,
>
> I have this use case where i need the lazy load a list of related prizes, 
> but the prizes are required to be in an order sequence, and this order 
> sequence is stored in the Relationship (PRIZES) property map. As the PRIZE 
> node are reusable across many Draws, the order sequence cannot be store 
> into the PRIZE node.
>
> Is there anyway to do this other than writing a cypher to resolve this?
>
> @NodeEntity
>
> public class Draw {
> .......
>
> @Fetch @RelatedTo(type=PRIZES, direction = INCOMING)
> Set<Prize> prizes;
>
> }
>
> e.g.
>
> Draw 1
> Prize iPhone, order 1
> Prize playStation 4, order 2
> Prize Xbox 3, order 3
>
> Draw 2
> Prize XBox 3, order 1
> Prize 42'inch TV, order 2
> Prize iPhone, order 3
>
>
>

-- 
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 neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to