Quote:
Someone correct me if I'm wrong. :)
That probably the correct way to do it for most situations, as it allows you to maintain your object-level abstractions.
If you really need/want to be able to "iterator with both instances of Player and Team in each row", then try:
Code:
Query q = session.createQuery("select p, p.team from Player as p");
which will return you a result where each row is an Object[] where the first dimension is the player object and the second is the palyer's team.
Or even more succintly, just turn around the perspective of the object query:
Code:
Query q = session.createQuery("from Player as p");
for (Iterator itr = q.list().iterator(); itr.hasNext(); )
{
final Player player = (Player)itr.next();
final Team team = player.getTeam();
...
}