Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading recursive relationship by loadAll by ids

Using the new Neo4j 2.3 OGM. When trying to load entities by id I have the following problem:

@NodeEntity
class Person {
    Long id;
    String name;

    @Relationship(type="Friend", direction = Direction.OUTGOING)
    public List<Person> friends;
}

assuming (1, "Alex") is friends with (2, "Joseph") and (3, "Guy"). (4, "Nati") is friends with (5, "Amit"), using the following code:

session.loadAll(Person.class, Arrays.toList(new Long() { 1L, 4L }), 1)

should return 2 Person objects, Alex containing two friends (Guy, Joseph) and Nati containing one friend yet what it actually returns is 5 objects (Alex, Guy, Joseph, Nati, Amit). Although Mike and Nati do contain their friends within, it seems weird (and certainly unwanted) that I requested Persons by two ids and got an Iterable containing 5. Does anyone know why this is? is this a bug?

like image 942
Nachshon Schwartz Avatar asked Oct 30 '22 16:10

Nachshon Schwartz


1 Answers

This issue is now fixed in 1.1.4-SNAPSHOT build.

like image 80
Vince Avatar answered Nov 21 '22 06:11

Vince