cakewalk. Hibernate team got dis one covuhed.
Here's a native SQL clob query that gets mapped automatically to the right persistent object.
------------------------------------------------
Code:
public Library selectByTitle(String title) throws DAOException {
String str = "select {lib.*} from Library lib where lib.title.compareTo(CAST( :title AS CLOB)) = 0";
SyncQuery query = HibernateUtil.getSession().createSQLQuery(str, "lib", Library.class);
query.setParameter("title", title);
return (Library) query.uniqueResult();
}