Below is HQL query that I use to obtains all columns from OrderDetail table and Name column from Item table.
Could I do this using QueryOver in which I do not need to manually list all OrderDetail’s columns in the Select clause of QueryOverProjectionBuilder statement, instead? Is there anyway to use “Select *” in QueryOver?
IList<OrderDetail> lstOD = Session.GetISession().CreateQuery("Select d, i.Name from OrderDetail d inner join d.Item i Where d.Order.Id = 1");
Appreciate your help.
There is currently no way to do a
SELECT *usingQueryOver, unfortunately. This has been discussed on the NH Google Group a few times. If you really want something like this, then you can extendQueryOverto iterate over all of the properties you’ve mapped and build up a projection list under the covers.