I have a situation of one-to-one relationship that I prefer the child class is referred with its ID instead of object on its parent class for the following reason:
When the parent object is retrieved along with the child, two DB trips are need: first to get the parent object and second to get the child object. The child object is a binary image file. To display it on a web page, I need to use a servlet for the task.
My question is whether the Hibernate can take care this situation so that I can't need to do anything manually on child object deletion or replacement or not.
Thanks for your input in advance.
|