title: adminId not saving in user table in a one to one relationship springboot
body: <p>I have mapped a one to many relationship between a user and an admin as shown in the user class</p>
  
  <pre><code>@Entity
  @Table(name = "user")
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "userId")
      private Long id;
      @Column(nullable = false)
      private String name;
      @Column(unique = true, nullable = false)
      private String email;
      @Column(nullable = false)
      private long timestamp;
  
      @OneToOne
      @JoinColumn(name = "adminId")
      Admin admin;
  </code></pre>
  
  <p>Now I am trying to save a user by inserting a value of 1 to the adminId field in the users table using SessionFactory of hibernate as shown</p>
  
  <pre><code>public void save(User user) {
  
          //User userAdmin = new User();
          long id = 1 ;
          user.setId(id);
  
          getSession().save(user);
      }
  </code></pre>
  
  <p><strong>EDITTED</strong></p>
  
  <p>Considering getters and setters, these are the fields in the admin table</p>
  
  <pre><code>@Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "adminId")
      private Long id;
  
      @Column(nullable = false)
      private String name;
  
      @Column(nullable = true)
      private String department;
  </code></pre>
  
  <p>My challenge is that when I save, nothing gets inserted <strong>(that is value of 1)</strong> on the adminId field referencing the admin foreign key in the users table.</p>
  
  <p>Kindly assist!</p>