I'm using Hibernate 3.0rc1 and the projections capability, but in the documentation I have not found any way to have it return a List of partially-filled objects instead of a List of Integers or whatever other data type specifically requested with projections. For example, this code:
Code:
List results = session.createCriteria(Cat.class)
.setProjection( Property.forName("name") )
.list();
would return a List of Strings, whereas what I need is a List of my Cat objects that only have their name set on them. This makes more sense when more than one property is desired, such as when 8 out of 10 properties are desired. If no such capability exists in Hibernate, does anyone know why? For my usage, it would be much more consistent and usable if I were able to get Cats back for every request regardless of how many properties were requested.
Thanks