Is there a way hibernate provides selective reference loading in case of objects with multi-level references
Say my object references are as below,
ServiceModel > FeatureModel > AttributeModel > EnumModel
Bundle > ServiceModel (without any references)
I need to load the ServiceModel object graph in one instance ( with all its dependencies), but during linking up of Bundle > ServiceModel, i dont need other references ( FeatureModel > AttributeModel > EnumModel) as this is unnecessary data according to the business scenario.
To solve this problem i created two model classes of ServiceModel
1. ServiceModelVO - Thick object with all references 2. ServiceModelThinVO - Thin object without any references
Bundle is related to ServiceModelThinVO, Bundle > ServiceModelThinVO
Is this the best approach to do so ? I followed the same approach for two, three other model classes as well resulting in lot of duplicate model bean classes. Does hibernate provide selective reference loading property ?
_________________ Cheers,
Vinod We act as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about
|