All APIs in Hibernate are from 1.4 and are thus not using java generics.
So I wonder how "safe" the following is: (preconditions: name column is of datatype String, or atleast compatible to String)
@SuppressWarnings("unchecked")
public List<String> getAll() {
Query q = session.createQuery(
"select name from Customers");
return q.list();
}
From the Queryi API (org.hibernate.Query.list()) javadoc.