Here is the situation I have:
The class A has a many-to-one relationship with the class B, while the class B has another many-to-one relationship with the class C. The class B refers the class C by object.
A main DB operation on the class A, other than saving, is retrieving all object with a HQL, somthing like "from A order by b, another-attribute". With a business logic ooperation, an object of the class C may need.
Shall I hava the class B referred in the class A by id or object? The by-object approach is convenient. But, I guess there are some performance penalty with this approach. The operation stated above will be perform periodically every hour. And the number of records can be large.
Thanks for your inputs.
|