5

In the following FluentNHibernate mapping:

public LawbaseAssetMap()
{
  Table("PRASSET");
  Id(x => x.Id).Column("PRA_RECNUM");   
  Join("PRSTOCK", m =>
  {
    m.Fetch.Join();
    m.Optional();
    m.KeyColumn("PRS_ASSRN");
    m.Map(t => t.Certificated).Column("PRS_CERT").CustomType("YesNo");
  });
}

I am performing an outer join from the table PRASSET to the table PRSTOCK. The join is between PRSTOCK.PRS_ASSRN and PRASSET.PRA_RECNUM (the primary key of PRASSET).

How would I create the equivalent join, but instead of joining onto PRASSET's primary key, join on to another field instead?

David
  • 15,750
  • 22
  • 90
  • 150
  • Looks like this is a dup: http://stackoverflow.com/questions/3442611/fluent-nhibernate-join-not-using-primary-key I was hoping for a better answer than References too :/ – adamhathcock Mar 22 '11 at 11:04
  • David, I have the same problem, so could you share the solution or workaround for your problem. – Alexey G. Apr 29 '11 at 13:59

1 Answers1

0

David have a look on following link, as i thing that it might help

Fluent NHibernate - Mapping a property to a column on a joined table

also this might help

ReferencesAny(x => x.Author)
  .EntityTypeColumn("Type")
  .EntityIdentifierColumn("Id")
  .IdentityType<int>();

See more here.

Hope this helps... and now really holliday :) see u

Community
  • 1
  • 1
cpoDesign
  • 8,953
  • 13
  • 62
  • 106