guicamest/InterfaceToDTO — Issue #17: Make HibernateDTOUtils
Author: guicamest
Created: 2011-10-18 00:24:37+00:00
State: open

let's say we have a query:

String hql = "select user.name, user.avatar, user.location from ..."
......
Query query = ...
......

write an interface (can be in the same .class but not the same class(inner) )
interface ISimplifiedUser{
String getName();

Image getAvatar();

Location getLocation();
}

And the usage:

List followData = DTOHibernateUtils.getFor(ISimplifiedUser.class).fromQuery(query);