> Not quite sure what your plan is :)
My "teacher" wants me to implement the value object pattern.

When I tried putting only [Nested] in SystemUser and putting
[PrimaryKey] into SystemUserId it tell me: "A type must declare a
primary key. Check type Messweb.Models.SystemUser.SystemUser"

I also tried it with komposite keys like mentioned at
http://www.castleproject.org/ActiveRecord/documentation/v1rc1/usersguide/pks.html
But that would demand a lot of modification in the existing
application. Another thing is, that this IS NOT REALLY a composite
key, since only one property is used for the key.

Any clues?

//Flo

On 6 Feb., 11:22, Mark Jensen <[email protected]> wrote:
> Not quite sure what your plan is :)
>
> but have you tried to removing PrimaryKey from this property
>
>                 [Nested("Id"), PrimaryKey]
>                 public SystemUserId Id
>                 {
>                         get { return mId; }
>                         set { mId = value; }
>                 }
>
> And I also think you need to remove the "id" from the Nested
> attribute, so it will be
>
>                 [Nested]
>                 public SystemUserId Id
>                 {
>                         get { return mId; }
>                         set { mId = value; }
>                 }
>
> Because if i remember correctly, the value you put into the Nested
> attribute is used as a prefix for column names.
>
> /Mark
>
> On Feb 6, 8:24 am, Flominator <[email protected]> wrote:
>
> > I uploaded it to this 
> > google-group:http://groups.google.com/group/castle-project-users/139
>
> > On 5 Feb., 16:47, Simon <[email protected]> wrote:
>
> > > Could you provide your SystemUser class.
>
> > > //Simon
>
> > > On Feb 4, 8:28 am, Flominator <[email protected]> wrote:
>
> > > > Hi there,
>
> > > > I'm trying to use a nested object as primary key. When I try to
> > > > initialize Active Record I get
>
> > > > "Could not determine type for: Messweb.Models.SystemUser.SystemUserId,
> > > > for columns: NHibernate.Mapping.Column(Id)"
>
> > > > Is there a way to do this or are my attempts futile?
>
> > > > Thanks in advance,
>
> > > > Flo
>
> > > > PS: I've uploaded my class SystemUser.cs to this group.
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to