I am really confused, how does column resultset mapping work? What am I mapping when I use columns instead of entities? Look at this example...
Query q = e
You map 4 fields from result set to 2 Java classes: first class is Order entity, and the second is (probably) String that shall contain "item_name" db field.
DB: Java
--- ----
order_id ---> \
order_quantity ---> Order entity
order_item ---> /
item_name ---> String
In order to read the query results:
for (Object[] record : query.getResultList()) {
Order order = (Order)record[0];
String itemName = (String)record[1];
}