This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Could someone point out what I'm doing wrong? I have a parent/child relationship between two objects, Customer and Order - a customer can have many orders. The tables are setup the same way and the two join on a pk/fk field called 'cust_id'.
So...it looks like this:
Customer.Orders = List<Order> (mapped as a bag, like so):
I'm trying to get a list of customers between an Order sent-date range. The customers I get back are ones that have orders within the date range but when I try to view the list of orders...they're not filtered...I'm getting every order ever entered by that customer...I would have expected the orders to be filtered as well...but they're not...and that's obviously because of the queries being generated.
My HQL looks like this:
...which generates a query that looks like this:
However...when I list the orders for each customer...like so:
It generates a query that looks like this:
...bingo...the Order.SentDate isn't filtered for the orders.
I know I'm missing something simple...but I've been staring at it for so long it's eluding me...can someone point out a simple work-around?