ProjectionList « Criteria « JPA Q&A





1. ProjectionList hibernate Criteria    coderanch.com

public static void main(String[] args) { HibernateUtil.setup("create table Supplier ( id int, name VARCHAR);"); HibernateUtil.setup("create table Product ( id int, name VARCHAR, description VARCHAR, price double,supplierId int);"); prepareData(); Session session = HibernateUtil.currentSession(); Criteria crit = session.createCriteria(Product.class); ProjectionList projList = Projections.projectionList(); projList.add(Projections.property("name")); projList.add(Projections.property("description")); crit.setProjection(projList); List results = crit.list(); displayObjectsList(results); HibernateUtil.checkData("select * from Supplier"); HibernateUtil.checkData("select * from Product"); }

2. Criteria ProjectionList    forum.hibernate.org

Hi there, i'm rather new to hibernate and i guess my problem is somewhre explained, but i really can't find information on that. Is there anything like a criteria API FAQ or tutorial or a more detailed documentation then part 16 of hibernate docs? My problem is that i don't know what's inside the list that is returned by the method ...