Actually Adam,
You are incorrect and you don't need to do that for the example the poster is asking about. You need to brush up on some of your Hibernate docs :)
Quote:
List l = entityManager.createNamedQuery("area&night").getReaultList();
What will be the object type of the result list?
You will get back a tuple Night and Area objects:
Code:
Query q = s.getNamedQuery( "night&areaCached" );
List result = q.list();
Night night = (Night) ( (Object[]) result.get( 0 ) )[0];
Area area (Area) ( (Object[]) result.get( 0 ) )[1];
If you look at the ResultSet mappings, you'll see that the example returns multiple types in the result set. Whenever Hibernate does this, it comes back as an array of Objects in the order they are defined in the mapping.
Ryan-