in addition, it appears that nhib is querying the Note table BEFORE
querying tickets


On Dec 29, 1:20 pm, fel0nious <[email protected]> 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 [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