condit
condit

Reputation: 10972

Multi-valued properties with Frame annotations

I'm trying to figure out how to support multi-valued properties with the Tinkerpop Frames API. I have an interface like this:

interface Node {

  @Property("synonyms")
  public Iterable<String> getSynonyms();

  @Property("synonyms")
  public void addSynonym(String synonyms);

}

The addSynonym call doesn't throw any exceptions but the getSynonyms alyways returns null. I also tried switching Iterable to Collection with no change.

Does Frames support multi-valued properties?

Upvotes: 1

Views: 181

Answers (1)

Bryn
Bryn

Reputation: 487

@Property in Frames does not support collection semantics as Tinkerpop 2.x does not allow this. It simply gets or sets the property on the underlying element.

The method prefixes supported for @Property are get, is, can, set and remove https://github.com/tinkerpop/frames/wiki/Core-Annotations

You could write your own method handler that supports this: https://github.com/tinkerpop/frames/wiki/Method-Handlers

Upvotes: 3

Related Questions