示例:
String hql = "select distinct m.manufacturerCode,m.manufacturerName,m.shortName from Manufacturer m"; List<Object> objectList = sessionFactory.getCurrentSession().createQuery(hql).list(); return objectList;
如果distinct多个字段,那么List里面装的是Object数组,如果是单个,装的是Object!