title: Modify JSon responce for @ManyToOne association using Jackson and Spring
body: <p>I have two classes:</p>
  
  <pre><code>public class Team {
      private Long id;
      private String name;
          ...
  }
  public class Event {
      private Long id;
  
      @ManyToOne
      private Team homeTeam;
  
      @ManyToOne
      private Team guestTeam;
  ...
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public @ResponseBody List&lt;Event&gt; getAll() {...
  }
  </code></pre>
  
  <p>Now I have Json:</p>
  
  <pre><code>[{"id":1,"homeTeam":{"id":2,"name":"Golden State"},"guestTeam":{"id":1,"name":"Philadelphia"},...
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>[{"id":1,"homeTeam":"Golden State","guestTeam":"Philadelphia",...
  </code></pre>
  
  <p>How I can point Jackson to output only name of Team instead of full Object?</p>