Here is an idea that I have had in the back of my mind for some time now.
It would be great, if one could map a query into a javabean property (return type collection or just first result from query).
Example:
person.getAllGirlfriends(String haircolor);
Then one could define the query in Person.hbm.xml with the "haircolor" parameter passed in as query parameter.
And, going a bit further, maybe it could be also possible to define this attribute as "prefetched", adding additional criteria to the outer join criteria by using the supplied parameter.
Am I just dreaming here or is this actually doable? :-)
And one more thing. Correct me if I'm wrong, but AFAIK, the current system allows to load (outer join) all dependent objects on first level (<set name="children" outer-join="true">). Would it be possible to specify the outer-join loading for more than one level deep? So I could load all girlfriends, their dogs and the dog parents in one query? And possibly adding some foreign key fetching also: load girlfriend, her father, fathers' mother, etc.
And to specify all of this within the scope of one property, so we could have:
person.getGirlfriends() - lazy collection of all girlfriends
person.getGirlfriendsWithFullData() - prefetch all girlfriends + their dogs, etc.
person.getFather() - lazy instance of father
person.getFatherWithGranny() - load data with more than one outer-join.
Did any of this make any sense?
Rgds, Neeme
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel