Right, I got that. But also need to disconnect the objects, so lazy-loading isn't appropriate for me.
Also, in some cases I do want to have all the related objects instantiated automatically, e.g. when I am editing them.
But in this case for dropdown lists, I only want to have the object on its own without any of its related parents or children.
As far as I understand, since I don't want to use lazy-load, I can only have one mapping file for the object, then I can only have one or the other (with related objects, or without).
So it seems the best solution for me is to set up a query to provide the lists of dropdowns I require, and to instantiate them with the variables I choose:
Code:
<query>
select new Country(c.countryId, c.name) from Country c
</query>
I'm going to try this but I'd appreciate it if anyone can tell me how orthodox this method is.
Thanks!