title: Spring Boot return null value for the relational entity after save
body: <p>I'm Working On a Spring Boot Application and I have two Entities AdminUsers And Blogs, These two Entities have OneToMany relationship and I wanted to Return all Blogs after save a blog, as follows</p>
  
  <pre><code>@PostMapping("/add")
      @ResponseBody
      public List&lt;Blog&gt; addBlog(@RequestBody Blog blog) {
  
          Blog savedBlog =  blogService.save(blog);
          return blogService.findAllBlogs();
  
      }
  </code></pre>
  
  <p>The problem I'm facing is tt returns null for the last inserted Blog's AdminUser all the time as follows,</p>
  
  <pre><code>[
      {
          "id": 30,
          "adminid": 1,
          "blogcontent": "blog dddcontent",
          "blogtitle": "titleaa",
          "datetime": "1111-12-31 23:59:59",
          "adminUser": {
              "adminid": 1,
              "adminusername": "admin",
              "adminemail": "admin@kongcepts.com",
              "adminpassword": "$2a$10$3aVlo8BkGbKQYzMDMDZTi.6dQavPeY8j0yD833ldA4utNAE4SxzpC",
              "status": 1,
              "attempts": 0,
              "resetToken": "$2a$10$6o7N/u4pgwjWya30wueVve9oqPNO6TTLidOg6NincqL5lOvLh03oa"
          }
      },
      {
          "id": 31,
          "adminid": 1,
          "blogcontent": "blog dddcontent",
          "blogtitle": "titleaa",
          "datetime": "1111-12-31 23:59:59",
          "adminUser": null
      }
  ]
  </code></pre>
  
  <p>But when I hit this endpoint after that</p>
  
  <pre><code> @GetMapping("/get/blogs")
  public List&lt;Blog&gt; listAllBlogs() {
      return blogService.findAllBlogs();
  }
  </code></pre>
  
  <p>It returns as expected</p>
  
  <pre><code>[
  
      {
          "id": 30,
          "adminid": 1,
          "blogcontent": "blog dddcontent",
          "blogtitle": "titleaa",
          "datetime": "1111-12-31 23:59:59",
          "adminUser": {
              "adminid": 1,
              "adminusername": "admin",
              "adminemail": "admin@kongcepts.com",
              "adminpassword": "$2a$10$3aVlo8BkGbKQYzMDMDZTi.6dQavPeY8j0yD833ldA4utNAE4SxzpC",
              "status": 1,
              "attempts": 0,
              "resetToken": "$2a$10$6o7N/u4pgwjWya30wueVve9oqPNO6TTLidOg6NincqL5lOvLh03oa"
          }
      },
      {
          "id": 31,
          "adminid": 1,
          "blogcontent": "blog dddcontent",
          "blogtitle": "titleaa",
          "datetime": "1111-12-31 23:59:59",
          "adminUser": {
              "adminid": 1,
              "adminusername": "admin",
              "adminemail": "admin@kongcepts.com",
              "adminpassword": "$2a$10$3aVlo8BkGbKQYzMDMDZTi.6dQavPeY8j0yD833ldA4utNAE4SxzpC",
              "status": 1,
              "attempts": 0,
              "resetToken": "$2a$10$6o7N/u4pgwjWya30wueVve9oqPNO6TTLidOg6NincqL5lOvLh03oa"
          }
      }
  ]
  </code></pre>
  
  <p>Here is my Entity classes for AdminUser and Blogs</p>
  
  <p>Admin User</p>
  
  <pre><code> @Entity
  @Table(name = "tbl_admin")
  public class AdminUser {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "admin_id")
      private Integer adminid;
  
      @Column(name = "admin_username", nullable = false)
      private String adminusername;
  
      @Column(name = "admin_email", nullable = false)
      private String adminemail;
  
      @Column(name = "admin_password", nullable = false)
      private String adminpassword;
      @Column(name = "admin_status")
      private Integer status = 1;
      @Column(name = "admin_attempt")
      private Integer attempts = 0;
      @Column(name = "admin_reset_token")
      private String resetToken;
  
      @OneToMany(mappedBy = "adminUser")
      @JsonIgnore
      private List&lt;Blog&gt; blog;
  </code></pre>
  
  <p>and Blog</p>
  
  <pre><code>@Entity
  @Table(name = "tbl_blog")
  public class Blog {
  
      @Id
      @Column(name = "blog_id")
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Integer id;
  
      @Column(name = "admin_id")
      private Integer adminid;
  
      @Column(name = "blog_content")
      private String blogcontent;
  
      @Column(name = "blog_title")
      private String blogtitle;
  
      @Column(name = "blog_datetime")
      private String datetime;
  
      @ManyToOne(fetch=FetchType.EAGER)
      @JoinColumn(name = "admin_id", updatable = false, insertable = false)
      private AdminUser adminUser;
  </code></pre>