title: Creating an instance of Entity in Spring without any Spring interaction
body: <p>In my project based on <code>spring-data-rest</code> I have some classes annotated with the <code>@Entity</code> annotation. </p>
  
  <pre><code>@Entity
  @Table(name = "my_table)
  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public class MyTable extends BaseTableEntity {
      private String name;
      private String description;
  }
  </code></pre>
  
  <p>Now I am not quite sure as to how Spring handles creation of new instances of classes annotated with that annotation. I needed to create an object of such an <code>Entity</code> class making sure that no database operations takes place.</p>
  
  <p>To make it clear, say I do <code>MyTable table = new MyTable()</code> in a POJO class. Can I be sure that Spring with the help of Hibernate/JPA won't create records in my database. What if I do the same in a <code>@Component</code> class instead of a POJO.</p>