spring-data: Problems with @To and @From annotation
do the To and From annotations work in the spring data project?
when I try to retrieve edge documents using the From attribute, I get “nested exception is java.lang.StackOverflowError”. I can see the docs and the edge in the database. but when I use the repository (actorRepository.findByName), i get the above error. When I remove the From annotation, I don’t get that error
@Edge(value = "roles")
public class Role{
@Id
private String id;
@From
private Actor actor;
@To
private Movie movie;
}
@Document
public class Movie movie{
@Id
private String id;
...other stuff...
}
@Document
public class Actor actor{
@Id
private String id;
private String name;
...other stuff...
@From
private List<Role> roles;
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 34 (21 by maintainers)
Commits related to this issue
- fix issue #43 (#57) — committed to arangodb/spring-data by christian-lechner 6 years ago
- fix issue #43 (#57) — committed to arangodb/spring-data by christian-lechner 6 years ago
I just released version
1.1.5
and2.1.6
which contains a fix for this bug.Thanks for explaining how this works. That’s what I meant by populated.
By “populated” you mean serialized by Jackson to JSON? Keep in mind that Jackson triggers the resolution of the lazy loading class with its serialization process (by accessing it).
If you don’t access movies before you set them to
null
, they are not loaded from the DB. So yes, you can reduce querying effort with this approach.Sets will be supported with the next release.
@bthj-tms I think I’ve fixed this issue with PR #57.
@mpv1989 can you please have a look at PR #57?