I use Scala.

In my class Meeting, I have this relation:

@RelatedTo(`type` = "TO", direction = Direction.INCOMING)
  var _participants: java.util.Set[Participation] = _

Participation is another node entity, linked to Meeting with an outgoing 
relationship "TO".

What I do is a simple test saving firstly a Meeting, and then saving three 
distinct Participations related to it.

I expect then to have a size of 3 when I do at the end of the process:   
neo4jTemplate.fetch(meetingRepository.findById(justSavedMeetingId.
_participants)

However, it only returns the first Participation that was linked to. Not 
the two others....

Note that it well works (size of 3 retrieved) when I add @Fetch, without 
explicitly using neo4jtemplate.fetch:

@Fetch @RelatedTo(`type` = "TO", direction = Direction.INCOMING)
  var _participants: java.util.Set[Participation] = _  //works

I tested it in the same transaction and in distinct transaction. 

Am I missed something obvious?

Thanks,

Michael


On Sunday, February 2, 2014 3:53:54 AM UTC+1, Michael Azerhad wrote:
>
> Hello,
>
> My question is pretty simple:  
> May it be a normal scenario when neo4jTemplate.fetch returns ALWAYS the 
> first collection's element?  (concerning a @RelatedTo collection's field 
> without any @Fetch annotation)
>
> On the contrary, when @Fetch is placed, the whole collection is well 
> retrieved.
>
> I did a workaround by rather use a Cypher Query (annotation in my 
> repository) to load the collection, but I would like to know if this 
> scenario could be explained.
>
> Thanks,
>
> Michael
>
>
>

-- 
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.

Reply via email to