I am using AutoMap exclusively as well (but am also very new at
this).  I have gotten the Many-to-one mapping without changing
manyToOnePart.write.

in the parent class I have:
public virtual IList<Child> Children { get; set; }

in child class I have:
public virtual Parent Parent { get; set; }

parent xml:

    <bag name="Children " inverse="true">
      <key column="FK_Parent" />
      <one-to-many class="IPCApplication.Entities.Model.Child,
IPCApplication.Entities, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null" />
    </bag>

child xml:

  <many-to-one name="Parent" column="FK_Parent" />


I also am using conventions to name the foreign keys and add the
inverse attribute - but the mapping was correct before I added that.

Is this what you were trying to do?



On Apr 24, 5:38 pm, Kevin Dente <[email protected]> wrote:
> FWIW, I was able to get past this by changing ManyToOnePart.Write. I
> changed
> if (_columns.Count == 0)
> to
> if ((_columns.Count == 0) && !String.IsNullOrEmpty(columnName))
>
> No idea if this is the "correct" fix, but it let me get past the
> block.
>
> On Apr 24, 11:04 am, Kevin Dente <[email protected]> wrote:
>
> > I'm fairly green with NHibernate and FNH, so hopefully this isn't a
> > totally dumb question.
>
> > I'm trying to fully automap a set of classes. One of the properties
> > results in a many-to-one mapping, but the resulting mapping XML has no
> > column name associated with the property (that is, the attribute is
> > there but blank), which makes NHibernate barf. Is this ever a
> > reasonable thing to expect it to do? Am I missing something obvious?
--~--~---------~--~----~------------~-------~--~----~
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