title: Select one column from a row in hibernate
body: <p>I am trying to do a simple query to get a unique result back in hibernate here is my code.</p>
  
  <pre><code>public String getName(Integer id) {
       Session session = getSessionFactory().openSession();
       String name = (String)session.createSQLQuery("SELECT name FROM users WHERE user_id = :userId").setParameter("userId", id).uniqueResult();
       return name;
  }
  </code></pre>
  
  <p>The name that is being returned is stored as HTML text that includes html syntacx language. I think this is what is causing the problem but it doesnt make sense I just want to return it as a string.</p>
  
  <p>It is only happening on this one field name, I can get every other field in the row but this one it gives me the error.</p>
  
  <p>I am getting an exception. The exception I am getting is</p>
  
  <blockquote>
    <p>No Dialect mapping for JDBC type: -1; nested exception is org.hibernate.HibernateException</p>
  </blockquote>
  
  <p>How do you query for a specific column on a row in hibernate?</p>