Hi,
When you use a projection list you get back results as "tuples", not the object that was used as the basis of the criteria.
You probably just need to add a line like...
Code:
criteria.setResultTransformer( new AliasToBeanResultTransformer(DDOEntity.class) );
...when using the projection. On another note, this...
Code:
List<Map<String,Object>> list = (List<Map<String,Object>>) criteria.list();
...is a bit difficult to read and seems counter productive. Why not...
Code:
List <DDOEntity> list = criteria.list();
...? Your compiler will complain about the "unsafe" manner of this type conversion, but it will compile and run and you'll get a list of your DDOEntity objects. I'm actually kind of surprised that you can go from what should be a list of DDOEntity to a list of Map in the case where you're not using the projection. In fact, I would say that what you've posted would only work when using a projection and should not work with the projection commented out. I'm probably not reading your code quite right, or missing something here...
Anyway, hope that helps.