Hi, I have a simple but important issue.
I have set up a small hibernate project (with a big database) and I just want to do a query on 2 tables of my db, like this :
select customer.customer_id, customer.customer_name, car.model, car.year where customer.purchase_id=car.purchase_id
I had already made a mapping of [i]customer[/i] before.
My questions are :
1 - I would like to know if I MUST do a mapping of [i]car[/i] to perform this query. Or do I just MUST change my [i]customer[/i] mapping (with a Join for example). Or do both ?
It seems that it is strange if I have to change my [i]customer[/i] mapping, Because I will have many different queries like this with other tables, so if it is the only solution someone will have to explain how this mapping change can be done in a flexible way.
2- Do I have to create a particular Java object to handle the result of this query (this would be very ugly to do...)
Please please, give me the best solution you see for this simple but very important problem.
thanks
|