views:

46

answers:

2

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.

A: 

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

Kevin Crowell
+1  A: 

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.

Pascal Thivent
Thank you a lot. And it works fine ^^
Wilhelm
Congratz for the 40k o/
Wilhelm
@Wilhelm Thanks ;)
Pascal Thivent