title: Unicode String in Hibernate Queries
body: <p>In SQL one can write a query that searches for a name of a person like this:</p>
  
  <pre><code>SELECT * FROM Person P WHERE P.Name LIKE N'%ike%'
  </code></pre>
  
  <p>This query would run with unicode characters (assuming that the Name column and database were setup to handle unicode support).</p>
  
  <p>I have a similar query in HQL that is run by Hibernate (NHibernate).  The generated query looks like:</p>
  
  <pre><code>SELECT P FROM SumTotal.TP.Models.Party.Person P join P.Demographics PD WHERE (PD.LastName LIKE '%カタカ%'  )
  </code></pre>
  
  <p>Unfortunately, placing a 'N' in front of the literal in the HQL results in an error.  I've tried escaping the unicode characters in the string and still no success.</p>
  
  <p>The database is accepting and saving unicode characters from Hibernate.  I've been able to successfully populate an object with a unicode string, save it with Hibernate, and verify it in the database.  It would seem to me as a little odd that I cannot use unicode strings in custom queries (or I'm also assuming named queries).</p>
  
  <p>Is this a known issue or limitation of Hibernate (Nhibernate)?  How do you use unicode in HQL?</p>
  
  <p>Several sites suggest using the Criteria queries.  Due to constraints in the framework that I'm working in, this is not possible.</p>