title: How To Use Jackson's @JsonIdentityInfo for Deserialization of directed Graphs?
body: <p>I want to use Jackson 2.3.3 for Deserialization/Serialization of directed graphs. The structure I came up with is roughly the following:</p>
  
  <pre><code>public Class Graph {
      private final Set&lt;Node&gt; nodes;
      public Graph(Set&lt;Node&gt; nodes) { ... }
      public Set&lt;Node&gt; getNodes() { ... }
  }
  
  @JsonIdentityInfo(
          generator = ObjectIdGenerators.PropertyGenerator.class,
          property = "name")
  public Class Node {
      private final String name;
      private final Set&lt;Edge&gt; edges;
      public Node(String name, Set&lt;Edge&gt; edges) { ... }
      public String getName() { ... }
      public Set&lt;Edge&gt; getEdges() { ... }
  }
  
  @JsonIdentityInfo(
          generator = ObjectIdGenerators.PropertyGenerator.class,
          property = "name")
  public Class Edge {
      private final String name;
      private final Node successor;
      public Edge(String name, Node successor) { ... }
      public String getName() { ... }
      public Node getSuccessor() { ... }
  }
  </code></pre>
  
  <p>And I expect to have this JSON-Structure:</p>
  
  <pre><code>{
    "graph": [{
      "name": "A",
      "edges": [{
        "name": "0",
        "successor": "B"
      }, {
        "name": "1",
        "successor": "A"
      }]
    }, {
      "name": "B",
      "edges": [{
        "name": "0",
        "successor": "A"
      }, {
        "name": "1",
        "successor": "B"
      }]
    }]
  }
  </code></pre>
  
  <p>But I get the following error while deserialization (even with annotation <code>@JsonProperty("name")</code> at the Getters):</p>
  
  <p><code>com.fasterxml.jackson.databind.JsonMappingException: Invalid Object Id definition for some.package.graph.Node: can not find property with name 'name'</code></p>
  
  <p>I have found some solutions for Jackson 1.6 with Back-Reference Annotations, but I'd like to use the new Jackson 2.x Annotation, as it was advertised so much in the API Update from 1.9 to 2.0 of Jackson.</p>
  
  <p>What point am I missing here? Thanks for constructive answers in advance.</p>
  
  <h2>EDIT</h2>
  
  <p>(Removed my answer from here to the Answer section)</p>