Hello,

I am trying to create a mapping file for entities which look like the
following:

public class Header
{
    public virtual int HeaderId { get; set; }
    public virtual Version LatestVersion { get; set; }
    public virtual VersionLatestApprovedVersion { get; set; }
    // other members
}

public class Version
{
     public virtual int VersionId { get; set; }
     public virtual Header Header { get; set; }
     // other members
}

The database looks almost exactly like this, with the obvious
difference being that instead of object references there are foreign
keys for the latest/latest approved versions pointing to the VersionId
field, and the same for the Header and HeaderId.  The table for the
header does allow both the latest and latest approved version ids to
be null to allow the Header records to be inserted before the Versions
are created.  The insert proc for the Version table takes care of
updating the Header.LatestVersionId to point at newly inserted version
record.

I have thus far been unsuccessful in creating mapping files for this
pattern, the sticking point being the LatestVersion and
LatestApprovedVersion properties. I'm pretty new to NHibernate, so I
apologize if this is answered in another thread.

Any help is much appreciated. Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en.

Reply via email to