You're right of course. But in my case I had reasons to model it this
way, mainly because the OneToOne association ended up not being a good
fit for my situation.

Still, thanks for pointing this out.

jeroen

On 11 nov, 14:16, Markus Zywitza <[email protected]> wrote:
> Yes, but you should use it the other way round. In this example, no
> user can exist without profile (it needs the foreign key as its ID),
> but the profile can exist without the user. For me, that violates all
> I know about users and profiles.
>
> -Markus
>
> 2009/11/11 jeroenh <[email protected]>:
>
>
>
> > Found the answer... One of the two Primary keys should obviously be of
> > type 'PrimaryKeyType.ForeignKey'.
>
> >>     [ActiveRecord]
> >>     public class TestUser : ActiveRecordBase<TestUser>
> >>     {
> >>         [PrimaryKey(PrimaryKeyType.Foreign)] // !! NOT GuidComb!
> >>         public Guid Id { get; set; }
>
> >>         [OneToOne(Cascade = CascadeEnum.All, Fetch = FetchEnum.Join)]
> >>         public TestUserProfile Profile { get; set; }
>
> >>     }
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "Castle Project Users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/castle-project-users?hl=.

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=.


Reply via email to