Sorry, but the quotes are not part of the query. I have removed them.
So the code look like :
String key = "4028fb7a";
hql = session.createQuery("SELECT f FROM com f WHERE f.id = :key" );
hql.setParameter("key", key);
list = session.find(hql.getQueryString());
But I get the following exception when running this code :
net.sf.hibernate.util.JDBCExceptionReporter - JZ0SA: Prepared Statement: Input parameter not set, index: 0.
net.sf.hibernate.util.JDBCExceptionReporter - Could not execute query
java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 0.
Ideas ?
|