Hi, I think you should tell NHibernate in which column of the NoteTable you store the reference to the TicketTable. You can do this in the NoteMap-class with the Column(string name) property of the ManyToOnePart. e. g. base.References(x => x.ParentTicket).Column("IdOfParentTicket_orwhateveritsnameis");
If you don't specify a column-name via the Column(string name) method, Fluent NHibernate tries to figure it out, and this time its guess was Ticket_id. Reka On 29 Dez., 19:20, fel0nious <fel0ni...@gmail.com> wrote: > My problem is that when querying for Tickets ... > > public IQueryable<Ticket> GetTickets() > { > return NHibSession.Query<Ticket>(); > } > > NHibernate is trying to query against the NoteTable, looking for a > column that does not exist: Ticket_id > > So far as I can tell, I'm doing exactly as the Fluent documentation > suggests, yet I'm running into this problem. > Suggestions? > > -------------------------------------------------------------- > > Domain: > > public class Ticket > { > public Ticket() > { > this.Notes = new List<Note>(); > } > > public virtual string TicketID { get; set; } > public virtual IList<Note> { get; set; }} > > public class Note > { > public virtual string NoteID { get; set; } > public virtual string TicketID { get; set; } > public virtual Ticket ParentTicket { get; set; } > > } > > Mapping: > > public class TicketMap : ClassMap<Ticket> > { > public TicketMap() > { > base.Id(x => x.TicketID) > .GeneratedBy.Sequence("ticketSeqName"); // working fine > base.Table("TicketTable"); // working fine > > base.HasMany<Note>(x => x.Notes) > .Inverse().Cascade.All(); > }} > > public class NoteMap : ClassMap<Note> > { > public NoteMap() > { > base.Id(x => x.NoteID) > .GeneratedBy.Sequence("noteSeqName"); // working fine > base.Table("NoteTable"); // working fine > > base.References(x => x.ParentTicket) > } > > > > > > > > } -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibern...@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.