Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用休眠从我的数据库(mySQL)表中获取所有数据,并将输出存储到对象列表中?
我将使用此列表来填充 JTable。
关于什么:
Query q = session.createQuery("from Foo"); List foos = q.list();
Foo表上映射的实体在哪里。但也许我错过了什么。
Foo
如果您使用 findAll(),它应该是 GenericDAO 的一部分,它会将所有内容作为列表返回。