1
votes

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:

  1. SpringBook - 1.5.9
  2. Arangodb-spring-data - 1.0.0
  3. Velocypack-module-jdk8 - 1.0.2
1

1 Answers

2
votes

this is a bug in arangodb-spring-data version 1.0.0.

I opened a github issue and already fixed it and released version 1.0.1.