title: Spring JPA creates entity with null values
body: <p>I have the following code:</p>
  
  <pre><code>groupModel.getUserFormGroups().clear();
  for(MemberDTO member : group.getMembers()){
      User u = userRepository.findByEmail(member.getEmail());
      System.out.println(member.getEmail() + " " + groupModel.getName() + " " + member.getRole());
      if(u == null){
          return new ResponseEntity&lt;&gt;(HttpStatus.BAD_REQUEST);
      }
      groupModel.getUserFormGroups().add(new UserFormGroup(u, groupModel, UserFormGroupRole.ADMIN));
  }
  
  try{
      groupRepository.save(groupModel);
      return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
  } catch (DataIntegrityViolationException e){
      System.out.println(e.getMessage());
      System.out.println(e.getClass());
      return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).build();
  }
  </code></pre>
  
  <p>When I run this, the new <code>UserFormGroups</code> have an id and all the other fields are null. Is there something wrong with fully updating a ManyToOne relationship?</p>
  
  <p>On the group entity I have the following OneToMany relation:</p>
  
  <pre><code>@OneToMany(targetEntity=UserFormGroup.class, cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.EAGER, mappedBy = "formGroup", orphanRemoval=true)
  private Set&lt;UserFormGroup&gt; userFormGroups = new HashSet&lt;&gt;();
  </code></pre>
  
  <p>And the UserFormGroup relation looks like this:</p>
  
  <pre><code>@Entity
  @Table(uniqueConstraints={
          @UniqueConstraint(columnNames = {"user", "form_group"})
  })
  public class UserFormGroup implements Serializable{
  
      @Id
      @GeneratedValue(strategy= GenerationType.AUTO)
      private long id;
  
      @ManyToOne
      @JoinColumn(name = "user",referencedColumnName = "id")
      private User user;
  
      @ManyToOne
      @JoinColumn(name = "form_group", referencedColumnName = "id")
      private FormGroup formGroup;
  
      @Column(name = "role")
      private UserFormGroupRole role;
  
      public UserFormGroup() {
      }
  
      public UserFormGroup(User user, FormGroup group, UserFormGroupRole role) {
          this.user = user;
          this.formGroup = group;
          this.role = role;
      }
  
      public User getUser() {
          return user;
      }
  
      public void setUser(User user) {
          this.user = user;
      }
  
      public FormGroup getFormGroup() {
          return formGroup;
      }
  
      public void setFormGroup(FormGroup formGroup) {
          this.formGroup = formGroup;
      }
  
      public UserFormGroupRole getRole() {
          return role;
      }
  
      public void setRole(UserFormGroupRole role) {
          this.role = role;
      }
  }
  </code></pre>