title: JPA and Predefined Instances of Entities
body: <p>I have an application using JPA (Hibernate implementation), in which I have several entities defined with annotations, e.g.</p>
  
  <pre><code>@Entity
  @Table(name="my_table")
  public class MyEntity {
    //various fields
  }
  </code></pre>
  
  <p>I also have an SQL script to insert records into the database as soon as the schema is created - these pre-inserted records are actually constant, so not expected to change during execution.</p>
  
  <p>Is it possible to get these pre-inserted records as static instances of the entities, e.g.:</p>
  
  <pre><code>@Entity
  @Table(name="my_table")
  public class MyEntity {
  
    public static MyEntity constantEntity...
    //various fields
  }
  </code></pre>