Question

How can I get ALL the data from a table of my DB (mySQL) using hibernate, and store the output into List of Objects?

I'll use this List, to populate a JTable.

Was it helpful?

Solution

What about:

Query q = session.createQuery("from Foo");
List foos = q.list();

Where Foo is an entity mapped on your table. But maybe I missed something.

OTHER TIPS

If you use findAll(), which should be a part of the GenericDAO, it returns everything as a List.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top