This content has been marked as final.
Show 3 replies
-
1. Re: Modeling
lhoriman May 5, 2005 5:15 AM (in response to lhoriman)To answer my own question...
Most of the important stuff is spelled out here:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=63002
Basically:
* Use a composite PK for Rating which has the raw Long values for personId and movieId.
* In addition, include the ManyToOne relationships in Rating, not as part of the PK, and make them insertable=false and updatable=false. Make sure they use the same JoinColumn as the columns in hthe composite PK.
Seems to work fine, and it's more convenient to create the simpler PK when doing lookups.
Jeff -
2. Re: Modeling
epbernard May 5, 2005 2:20 PM (in response to lhoriman)if you can use a surrogate key, you won't have to use a composite pk
-
3. Re: Modeling
lhoriman May 5, 2005 5:00 PM (in response to lhoriman)"epbernard" wrote:
if you can use a surrogate key, you won't have to use a composite pk
I wouldn't be able to do cached lookups on the real-world key (ie, {PersonId,MovieId}.
I'm actually pretty happy with the existing solution.
Jeff