我来了!  在实体里面  建立一个有参构造函数,
public District(Integer id,String name) {
this.id=id;
this.name=name;
} public Street(Integer id,String name) {
this.id = id;
this.name = name;
}查询的时候这样,。。
/**
 * 获得所有的街道
 */
@SuppressWarnings("unchecked")
public List<District> queryAll() {
Session hs = null;
List<District> listD = new ArrayList<District>();

try {
hs = HibernateSessionFactory.getSession();
String hql = "SELECT new District(d.id,d.name) from District d";
Query query = hs.createQuery(hql);

List list = query.list();
for (int i=0;i<list.size(); i++) {
District district = (District)list.get(i);
listD.add(district);
}
} catch (HibernateException e) {
e.printStackTrace();
} finally{
hs.close();
}
return listD;
}给分哦