title: Querying for CLOB attribute in JPA
body: <p>I want to search for a value of the datatype CLOB in the database. The attribute in the entity looks as follows:</p>
  
  <pre><code>@Column(name = "FILE_NAME")
  @Convert(converter = CryptoConverter.class)
  @Lob 
  private String fileName;
  </code></pre>
  
  <p>Unfortunately I am not able to query like this:</p>
  
  <pre><code>Query query = entityManager.createQuery("SELECT o FROM OracleDok o WHERE o.fileName = :fileName", OracleDok.class);
  query.setParameter("fileName", hanaDok.getFileName());
  </code></pre>
  
  <p>This will lead to the following exception:</p>
  
  <blockquote>
    <p>Inconsistent datatypes: expected - got CLOB</p>
  </blockquote>
  
  <p>A native query would work - but the value is encrypted so I cannot use the filtervalue to match it against the value in the database because I can't crypt it manually with the key the databaseentry was encrypted.</p>
  
  <p>How can I achieve this? Is there any way to set a parameter correctly?</p>