I would like to select a single column instead of a whole object, using Hibernate. So far I have this:
List<String> firstname = null;
firstname = getSession().createCriteria(People.class).list();
My problem is that the above code returns the whole People table as an object instead of just "firstname". I'm not sure how to specify to only return "firstname" instead of the whole object.
question from:
https://stackoverflow.com/questions/10652358/how-do-you-select-a-column-using-hibernate 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…