查询 某几列
String hql = "select new User( u.id u.name ,u.password,u.collage,u.email,u.qq) from User u";
List<User> list = session.createQuery(hql).list();
一对多关联关系要映射
只需要在一的一方
@OneToMany
private Set<Content> contents=new HashSet<Content>();
便会生成一张中间表来管理两者之间的关系。