I am using Hibernate as my ORM solution and have a need for a highly specialized object (for performance reasons) to be returned that is unlike my original object.
Is it valid to actually set up a second object with its own mapping file so I can set special join fetching and set batch sizes and so forth? Can 2 classes point back to the same table? Will this cause some strange results when trying to make an update on the original object?
Should I try and set parameters at run time for this fetch plan?
Maybe use a stored procedure to accomplish this?
This object structure is complex and involves traversing collections of collections and I am trying to eliminate the chattiness of the original object. I like the sound of option 1 since it would seem the easiest to configure and get going. Thanks!