I just had the same problem, various links suggested upgrading spring to 4.0.1+ and hibernate to 4.3.x but this didn't make any difference. Then I came across this link which resolved my issue. The author writes a custom ResultTransformer for the Clob and then setting this as the as the transformer for you query instead of AliasToEntityMapResultTransformer.
http://javatechtricks.blogspot.co.uk/2012/12/hibernate-clob-to-string-conversion.html
Code from the article below:
public class MyResultTransformer extends BasicTransformerAdapter {
public final static MyResultTransformer INSTANCE;
static {
INSTANCE = new MyResultTransformer();
}
private MyResultTransformer() {
}
private static final long serialVersionUID = 1L;
@Override
public Object transformTuple(Object[] tuple, String[] aliases) {
Map<String, Object> map = new HashMap<String, Object>();
for (int i = 0; i < aliases.length; i++) {
Object t = tuple[i];
if (t != null && t instanceof Clob) {
Clob c = (Clob) tuple[i];
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
IOUtils.copy(c.getAsciiStream(), bos);
t = new String(bos.toByteArray());
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
map.put(aliases[i], t);
}
return map;
}
}
Then in your code replace
query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
with
query.setResultTransformer(MyResultTransformer.INSTANCE);
In addition, an alternative solution could be to change the column type, I havn't tried it myself.
JDBC large objects The types blob and clob provide mappings for the Blob and Clob classes in the java.sql package. If you are dealing with truly large values, your best bet is to declare the properties as either Blob or Clob—even though this introduces an explicit JDBC dependency to your data object, it easily allows Hibernate to leverage JDBC features to lazily load the property value only if you need it.
If you are not worried that the data is too huge, you can spare yourself this direct JDBC interface, declare the property type as String or byte[ ], and map it using text or binary. These correspond to SQL column types of CLOB and VARBINARY (RAW in Oracle, BYTEA in PostgreSQL), respectively, and the values are loaded immediately into the properties when the object is loaded.
Source: http://oreilly.com/java/excerpts/harnessing-hibernate/hibernate-types.html