Regular |
|
Joined: Mon Oct 20, 2003 3:14 am Posts: 53 Location: Sterling, VA, USA
|
I'm using Hibernate 3b4.
I currently have a User and UserWidget object (1->N Association), that works great as/is.
Each Widget has a type property (not unique) and an identifie property (is unique).
I'm finding myself needing to find the identifier field in the user's "primary" type widget ALOT. Right now User.getPrimaryWidgetId() has to look at all the widgets and find the right one. I want to improve this.
What I REALLY want is to have Hibernate do an OuterJoin whenever I get User and fill in the primaryWidgetId field in the User class...I dont see how to do that though...
Since using Hibernate 3, I suppose I can "re-map" the 1->Many association of the UserWidget class (Essentially make a "PrimaryWidget" class which is UserWidget + appropriate HQL/SQL) and a 1-1 association to it from User...but that's not quite what I want.
Can I do this? I'm sure I'm being dense, but I have looked and didn't see my answer (I fully expect an annoyed response and a pointer to the docs showing what I missed/misread).
TIA
[/i]
_________________ "A statistician is a mathmetician, broken down by age and sex".
|
|