title: Hide Object reference in JSON serialization by Jackson when using @JsonIdentityInfo
body: <p>I have two entities: Category and Item.</p>
  
  <p>Category Entity:</p>
  
  <pre><code>@JsonInclude(Include.NON_EMPTY)
  @JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class)
  @Entity
  public class Category {
      @Id
      @GeneratedValue
      private int id;
  
      private String categoryName;    
  
      @OneToMany(mappedBy = "category")   
      private List&lt;Item&gt; itemList;
  
      //have getters and setters  
  }
  </code></pre>
  
  <p>Item Entity:</p>
  
  <pre><code>    @JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class)
      @Entity
      public class Item {
  
      @Id
      @GeneratedValue
      private int id;
      private String itemName;
  
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "fk_Category_id")    
      private Category category;
  
      //have getters and setters              
  }
  </code></pre>
  
  <p>After doing a left join query like this:
  "SELECT c from Category c Left JOIN FETCH c.itemList il"</p>
  
  <p>I got the result and then I have  done hibernate aware JSON serialization to the result.</p>
  
  <p>My HibernateAwareObjectMapper is: </p>
  
  <pre><code>public class HibernateAwareObjectMapper extends ObjectMapper {
            public HibernateAwareObjectMapper() {   
                  Hibernate4Module hibernateModule = new Hibernate4Module();
                  hibernateModule.disable(Hibernate4Module.Feature.FORCE_LAZY_LOADING);
                  registerModule(hibernateModule);
            }
          } 
  </code></pre>
  
  <p>And HibernateAwareSerializerFactory is:</p>
  
  <pre><code>public class HibernateAwareSerializerFactory extends BeanSerializerFactory {
                  protected HibernateAwareSerializerFactory(SerializerFactoryConfig config) {
                      super(config);
                  }
              }
  </code></pre>
  
  <p>In my dispatcher servlet I have written:</p>
  
  <pre><code>    &lt;mvc:annotation-driven&gt;
                  &lt;mvc:message-converters&gt;
                      &lt;bean
                          class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"&gt;
                          &lt;property name="objectMapper"&gt;
                              &lt;bean class="org.scinv.hibernateAwareMapper.HibernateAwareObjectMapper" /&gt;
                          &lt;/property&gt;
                      &lt;/bean&gt;
                  &lt;/mvc:message-converters&gt;
          &lt;/mvc:annotation-driven&gt;
  </code></pre>
  
  <p>So, I have got a JSON Like this:</p>
  
  <pre><code>   {
        "ArrayList": [
          {
            "@id": "971ef69e-1605-46f2-8234-b595e38be11a",
            "id": 1,
            "categoryName": "fruit",
            "itemList": [
              {
                "@id": "75a3a7e5-ce66-4f6d-a04c-d04145d92b21",
                "id": 1,
                "itemName": "mango",
                "category": "971ef69e-1605-46f2-8234-b595e38be11a"
              },
              {
                "@id": "0aa0fb71-2909-4909-8403-0765829ee8c1",
                "id": 2,
                "itemName": "apple",
                "category": "971ef69e-1605-46f2-8234-b595e38be11a"
              },
              {
                "@id": "02c381cb-33fa-45a6-bff9-ec146357f4bc",
                "id": 3,
                "itemName": "orange",
                "category": "971ef69e-1605-46f2-8234-b595e38be11a"
              }
            ]
          },
          "971ef69e-1605-46f2-8234-b595e38be11a",
          "971ef69e-1605-46f2-8234-b595e38be11a"    
        ]
      }
  </code></pre>
  
  <p>In this JSON,
  there is "@id": "971ef69e-1605-46f2-8234-b595e38be11a"
  which is Object Id for Category Entity.</p>
  
  <p>And there is "@id": "75a3a7e5-ce66-4f6d-a04c-d04145d92b21" 
  which is Object Id for Item Entity.</p>
  
  <p>Category has 3 items So Catagory's object Id is also showing 2 more times.
  Like this: "971ef69e-1605-46f2-8234-b595e38be11a","971ef69e-1605-46f2-8234-b595e38be11a"</p>
  
  <p>That Generated JSON serialization is as expected.
  But I just need to hide that Object reference "@id" in that json. This "@id" is by default created by @JsonIdentityInfo. </p>
  
  <p>So I need configuration for @JsonIdentityInfo to hide Object Id "@id".
  I have tried @JsonIgnore but failed.</p>
  
  <p>I have googled 2 days for solution but failed.Can anyone give me a solution or a suggestion?  </p>