title: How to insert data into JPA Entity table using a setters method from class?
body: <p>Heres how I created the table and defined a set method: </p>
  
  <pre><code>@Entity
  @Table(name = "Book")
  public class Book extends AbstractPersistable&lt;Long&gt; {
  
  @Column(name = "id")
  private Long id;
  @Column(name = "name")
  private String name;
  
  public void setContent (String name) {
      this.name = name;
  }
  }
  </code></pre>
  
  <p>From the controller this is how I am trying to set the content:`</p>
  
  <pre><code>@RequestMapping("/addBook")
  @ResponseBody
  public String addBook(@RequestParam("name") String name) {
      Book book = new Book();
      book.setContent(name);
      return name;        
  }
  </code></pre>
  
  <p>When I set a new content from addBook page using the name parameter value, the content shows up on the same page. Now what I am trying to do is to insert more content to the table but I am not sure if the content is inserted to the table or not. I need to add more contents to the table. Is the setContent method updating or inserting content? And how am I supposed to see the table if it has contents?</p>