Hello together,

I am trying to map a collection of "MyClass" without explicit back-
reference to "MyFatherClass".
When saving "MyFatherClass" for the first time, the collection of
"MyClass" is saved and
can be loaded perfectly.

Saving "MyFatherClass" with an EMPTY collection of "MyClass" and
adding
adding the elements of "MyClass" LATER to the collection -- then re-
saving "MyFatherClass" --
leads to the ForeignKey-column holding "null", i.e. the collection is
empty on loading.

Would be very grateful if anyone could help me out...



Attribute mappings:

//father class
[JoinedSubclass(ExtendsType = typeof(MyFatherClassBase), Lazy = true)]
[Key(Column = "MyFatherClassBaseGuid")]
public class MyFatherClass : MyFatherClassBase
{

    //property-mapping:
    [Bag(0, Lazy = true, Cascade = CascadeStyle.AllDeleteOrphan)]
    [Key(1, Column = "MyFatherClassGuid", ForeignKey =
"FK_M_MyClass")]
    [OneToMany(2, ClassType = typeof(MyClass))]
    public virtual IList<MyClass> MyClassCollection
        ....
}

//referenced class
[Class(Lazy=true)]
public class MyClass ...
{
   ...
}

--~--~---------~--~----~------------~-------~--~----~
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