Arangodb and Spring Data

20 views
Skip to first unread message

Rob Gratz

unread,
Apr 1, 2020, 4:58:54 PM4/1/20
to ArangoDB

I am trying to see if Arango DB can be used in a Spring Data application.  I know there is a Spring Data implementation for Arango but am having trouble getting it to work as I think it should.  I guess my question is, if I have a parent object that has a child object as a field, is there any annotation on the child object field that will make the parent save off a relationship with the child?


class Parent {
  private Child child;
  Parent(Child child)
  {
    this.child = child;
  }
}

class Child {
  private String name;
  Child(String name)
  {
    this.name = name;
  }
}


Is there a way that this command will create both the child and the parent and the relationship/edge between them?
repo.save(new Parent(new Child("sam"));

If the answer is that I have to save them all independently then I don't believe this is a very good implementation for Spring Data.  To me I shouldn't have to have 3 different repos and make 3 different calls to save a simple object graph.

Any help would be gladly appreciated.

Michele Rastelli

unread,
Apr 2, 2020, 4:39:50 AM4/2/20
to ArangoDB
Reply all
Reply to author
Forward
0 new messages