title: How to create a Clob in JPA in an implementation agnostic way
body: <p>I am using Ejb3 and JPA (based on Hibernate and Oracle 10g at the moment)</p>
  
  <p>I have an entity that contains a clob</p>
  
  <pre><code>@Entity
  @Table(name = "My_TAB")
  public class ExampleEntity implements java.io.Serializable {
  
      private Clob someText;
  
      public void setSomeText(Clob someText) {
          this.someText= someText;
      }
  
      @Column(name = "COLUMN_NAME")
      public Clob getSomeText() {
          return this.someText;
      }
  </code></pre>
  
  <p>Then I want to save an entity of this type.</p>
  
  <p>At the moment I am doing the following which works <strong>perfectly</strong></p>
  
  <pre><code>ExampleEntity exampleEntity = new ExampleEntity();
  exampleEntity.setSomeText(Hibernate.createClob(aStringValue));
  someOtherDao.save(exampleEntity);
  </code></pre>
  
  <p>However this ties my code to Hibernate! I have specifically avoided so far Hibernate extensions and used only JPA annotations. The code works because indeed Hibernate is my current implementation.</p>
  
  <p>Is there some sort of JPA API that allows me to create a clob in a generic way? So if later I decide to switch to Toplink/EclipseLink or something else I won't have to change a thing?</p>