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?
This issue is now fixed in 1.1.4-SNAPSHOT build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With