ryzam wrote:
"let's client call DAO and return Domain Object to client.. and you can have GetOrderCount() in your Customer class which will return ordercount value.
But that is the point. How does the Customer class know the order count. Well, the Customer has of course a property Orders which is a list with the orders. But it gets loaded lazily and if a customer has a lot of orders I don't want to load all of them due to performance issues.
It maybe for example that I need a list of all the customers and there orders count. It would be totally inefficient to NOT query this via HQL. Or are these things just not possible?