Hello,
I have a little problem mapping a component with a reference to its
entity.
Here are my classes:

Two Classes Using the Component:

Public Class Class1
        Protected m_ID As Guid
        Protected m_Adress as Adress


        Public Overridable Property ID() As Guid
                Get
                        Return m_ID
                End Get
                Set(ByVal Value As Guid)
                        m_ID = Value
                End Set
        End Property

        Public Overridable Property Adress() As Adress
                Get
                        Return m_Adress
                End Get
                Set(ByVal Value As Adress)
                        m_Adress = Value
                End Set
        End Property
End Class

Public Class Class2
        Protected m_ID As Guid
        Protected m_Company as Adress


        Public Overridable Property ID() As Guid
                Get
                        Return m_ID
                End Get
                Set(ByVal Value As Guid)
                        m_ID = Value
                End Set
        End Property

        Public Overridable Property Company() As Adress
                Get
                        Return m_Company
                End Get
                Set(ByVal Value As Adress)
                        m_Company = Value
                End Set
        End Property
End Class

The Component, how to declare the Parent????

Public Class Adress
        Protected m_Name As String
        Protected m_Parent as MyParent????


        Public Overridable Property Name() As String
                Get
                        Return m_Name
                End Get
                Set(ByVal Value As String)
                        m_Name = Value
                End Set
        End Property

        Public Overridable Property Parent() As MyParent????
                Get
                        Return m_Parent
                End Get
                Set(ByVal Value As MyParent????)
                        m_Parent = Value
                End Set
        End Property
End Class

Mappings:

Public Class MapAdress
        Inherits ComponentMap(Of Adress)
        Public Sub New()
                Map(Function(x As Adress) x.Name).Not.Nullable.Length(60)
                ParentReference(Function(x As Adress) x.Parent)
        End Sub
End Class

Public Class MapClass1
        Inherits ClassMap(Of Class1)
        Public Sub New()
                id(Function(x as Class1) x.ID)
                Component(Function(x As Class1) x.Adress)
        End Sub
End Class

Public Class MapClass2
        Inherits ClassMap(Of Class2)
        Public Sub New()
                id(Function(x as Class2) x.ID)
                Component(Function(x As Class2) x.Adress)
        End Sub
End Class


How do I declare the Parent Entities in the Component??

Michael

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

Reply via email to