Domanda

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?

È stato utile?

Soluzione

@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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top