通过titles的类型查询对应信息 Titles t=new Titles(); List type=dao.getalltype(t); for(String types:type){ System.out.println(types); } HibernateSessionFactory.closeSession(); }