title: Prevent field of JSON object to be excluded, while serializing one-to-many relationship in springboot
body: <p>i have 2 classes , one for User details and other for User fitness
  all i want is to exclude <strong>name</strong> field from final json object of FitnessRecord class using <strong>FitnessRecordRepository.findAll()</strong>.
  this is my json output now.</p>
  
  <pre><code>{
      "fitness_id": 1,
      "date_of_performance": "2018-04-06",
      "user": {
          "user_id": 1,
          "name": "Hilal Kaldane",
          "email": "hilalkaldane@gmail.com"
      }
  }
  </code></pre>
  
  <p>and what i want is </p>
  
  <pre><code>{
      "fitness_id": 1,
      "date_of_performance": "2018-04-06",
      "user": {
          "user_id": 1,
          "email": "hilalkaldane@gmail.com"
      }
  }
  </code></pre>
  
  <p><strong>User.class</strong></p>
  
  <pre><code>public class User {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Integer user_id;
  
  @NotNull
  private String name;
  
  @NotNull
  @Column(unique = true)
  private String email;
  
  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
  private Set&lt;FitnessRecord&gt; fitness_record = new HashSet&lt;&gt;();
  
  
  
  //Getter and Setters are omitted
  }
  </code></pre>
  
  <p><strong>FitnessRecord.class</strong></p>
  
  <pre><code>public class FitnessRecord {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Integer fitness_id;
  
  public Integer getFitness_id() {
      return fitness_id;
  }
  
  public void setFitness_id(Integer fitness_id) {
      this.fitness_id = fitness_id;
  }
  
  @JoinColumn(name="user_id")
  @ManyToOne
  private User user;
  
  @Temporal(TemporalType.DATE)
  private Date date_of_performance;
  }
  </code></pre>
  
  <p><strong>Note:-</strong> <em>I dont want to use JSON ignore on User Class, since i will be using the</em> <strong>name</strong> <em>field in other places such as user information retrieval</em></p>