Sorry, trying to muddle through the code to see if I'm smart enough to
come up with a test and a patch, but in the mean time, I figured I
should find out if I'm just way off base.

Running NH 2.1 Alpha with latest checkout from FNH (svn, haven't
gotten git yet)

Given the following mapping:

            mapping.Component(x => x.ContactInfo, c =>
            {
                c.WithParentReference(x => x.Kennel);

                c.HasMany(cx => cx.ContactPoints)
                    .WithTableName("Contact")
                    .KeyColumnNames.Add("KennelId")
                    .Not.LazyLoad()
                    .AsSet()
                    .Access.AsReadOnlyPropertyThroughCamelCaseField();

            }).Access.AsReadOnlyPropertyThroughCamelCaseField();

NHibernate will throw an invalid config exception that parent is an
invalid child of component.

The output mapping is:

    <component name="ContactInfo" insert="true" update="true"
access="nosetter.camelcase">
      <set name="ContactPoints" lazy="false"
access="nosetter.camelcase" table="Contact">
        <key column="KennelId" />
        <one-to-many class="KennelFinder.Contact, KennelFinder,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      </set>
      <parent name="Kennel" />
    </component>

The problem is that component xsd declares a sequence in which parent
must come first:

        <xs:element name="component">
                <xs:complexType>
                        <xs:sequence>
                                ....
                                <xs:element ref="parent" minOccurs="0" />
                                <xs:choice minOccurs="0" maxOccurs="unbounded">
                                   ....
                                        <xs:element ref="set" />
                                   ....
                                </xs:choice>

As you can see, the two are inverted in the output.

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