In JDBC, you can return two result sets. In hibernate, you can't: even if you could, it wouldn't help much, as you still have to issue two selects to do that, and thus you might as well do it using two queries.
The ORM way of doing this would be to map a collection of books in each author, then just select all authors. Not an array, but certainly grouped by author.
If you want only a simple report query, returning the books ordered by author (for easy grouping in java), that's easy. If you need help with that, post again.
_________________ Code tags are your friend. Know them and use them.
|