title: JPA mapping an java.io.File or java.nio.file.Path object to a STRING column
body: <p>assume the following Entity:</p>
  
  <pre><code>@Entity
  public class MyEntity {
      @Id
      private Long id;
  
      private File path;
  
      private String someString;
  }
  </code></pre>
  
  <p>which I want to map to such a table:</p>
  
  <pre><code>CREATE TABLE (id BIGINT, path VARCHAR, somestring VARCHAR);
  </code></pre>
  
  <p>The problem ist the mapping from <code>java.io.File</code> (or <code>java.nio.file.Path</code>) to a simple string representing the file path.
  Is such a mapping possible with JPA?</p>
  
  <p>Of course, I could define <code>path</code> as a string and let the client create the <code>File</code> or <code>Path</code> object. But it is much more handy to provide these objects directly in the entity.</p>