I have a simple collection of "Book" and "Information" connected by the edge of "InformationOf".
@Data
@Accessors(chain = true)
@Document("books")
@HashIndex(fields = {"title", "authors.name"}, unique = true)
public class Book {
@Id
private String id;
private String title;
private Collection<Author> authors;
private Collection<Identifier> identifiers;
private Timestamp timestamp;
@Relations(edges = InformationOf.class, lazy = false,maxDepth = 3)
private Collection<Information> information;
}
@Edge
@Data
@Accessors(chain = true)
public class InformationOf {
@Id
private String id;
@To
private Book book;
@From
private Information information;
}
@Data
@Accessors(chain = true)
@Document(value = "information")
public class Information {
@Id
private String id;
private Collection<String> covers;
private Map<DescriptionType, Description> descriptions;
}
and simple repository
public interface BookRepository extends ArangoRepository<Book>{
Optional<Book> findOneByTitle(String title);
}
First saving work fine but reading with nested collection "Information" throw exception:
Caused by: com.arangodb.ArangoDBException: Response: 500, Error: 1521 - AQL: collection not known to traversal: 'information'. please add 'WITH information' as the first line in your AQL (while executing)
Dependency:
- SpringBook - 1.5.9
- Arangodb-spring-data - 1.0.0
- Velocypack-module-jdk8 - 1.0.2