title: Return an Entity object from a controller not managed by spring data-rest
body: <p>I have a <code>Parent</code> entity along with it's <code>ParentRepository</code> as follows</p>
  
  <pre><code>@RepositoryRestResource(collectionResourceRel = "Parent", path = "parent")
  public interface ParentRepository extends PagingAndSortingRepository&lt;Parent, Long&gt;{
  
  }
  </code></pre>
  
  <p><code>GET: /parent/10</code> returns this output as expected</p>
  
  <pre><code>{
    "pid" : 10,
    "parentName" : "Parent 10",
    "_links" : {
      "self" : {
        "href" : "http://localhost:1111/app/api/v2/parent/10"
      },
      "parent" : {
        "href" : "http://localhost:1111/app/api/v2/parent/10"
      },
      "children" : {
        "href" : "http://localhost:1111/app/api/v2/parent/10/children"
      }
    }
  }
  </code></pre>
  
  <p>I have a <code>@RestController</code> method as follows :</p>
  
  <pre><code>@RequestMapping(value = "/getdummy")
      public Parent getdummy() {
          //Session session = em.unwrap(Session.class);
          //Parent parent=(Parent)session.get(Parent.class, new Long(10));
          Parent parent=new Parent();
          parent.setPid(new Long(1111));
          parent.setParentName("Parent name");
          Child c1=new Child();
          c1.setChildName("C1");
          c1.setChildKey(new Long(1234));
          c1.setParent(parent);
          Child c2=new Child();
          c2.setChildName("C2");
          c2.setChildKey(new Long(1235));
          c2.setParent(parent);
          List&lt;Child&gt; children=new ArrayList&lt;&gt;();
          children.add(c1);
          children.add(c2);
          parent.setChildren(children);
  
          return parent;
  
      }
  </code></pre>
  
  <p>This method is expected to return a JSON as below:</p>
  
  <pre><code>{
      "pid": 1111,
      "parentName": "Parent name",
      "children": [{
          "childKey": 1234,
          "childName": "C1",
          "grandChildren": null
      },
      {
          "childKey": 1235,
          "childName": "C2",
          "grandChildren": null
      }]
  }
  </code></pre>
  
  <p>But what I get is this</p>
  
  <pre><code>{
    "pid" : 1111,
    "parentName" : "Parent name"
  }
  </code></pre>
  
  <p>The only way I was able to make it work with spring data rest was by converting the<code>Parent</code> object to <code>String</code> using Jackson's <code>ObjectMapper</code></p>
  
  <p>I tried excluding spring data-rest from my POM, and it gives the expected output. How do I exclude a particular Controller/Method from the data-rest interceptor?</p>
  
  <p><a href="https://bitbucket.org/rkysh/spring-repo/src" rel="nofollow noreferrer">Source here</a></p>