I have many-one mappings working fine, but the one-to-many relationship between locations and location_times continues to give me an error.
I keep getting this error: 
in this line of code: 
The mappings are as follows:
Location:
public virtual IList<LocationTimes> LocationTimes { get; set; } public virtual int locationID { get; set; } public virtual IList<LocationTimes> LocationTimes { get; set; } public Location() { LocationTimes = new List<LocationTimes>(); }
Location Map:
public class LocationMap : ClassMap<Location> { public LocationMap() { Table("Locations"); Id(x => x.locationID).Column("ID"); HasMany(x => x.LocationTimes) .Inverse() .Cascade.All();
Location table:
CREATE TABLE [dbo].[Locations]( [ID] [int] IDENTITY(1,1) NOT NULL ... CONSTRAINT [PK_Locations_1] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
LocationTimes:
public class LocationTimes { public virtual int ID { get; set; } public virtual Location Location { get; set; } }
LocationTimesMap:
public class LocationTimesMap : ClassMap<LocationTimes> { public LocationTimesMap() { Table("Location_Times"); Id(x => x.ID); References(x => x.Location).Column("LID"); } }
Location_times table:
CREATE TABLE [dbo].[Location_Times]( [ID] [int] IDENTITY(1,1) NOT NULL, [LID] [int] NULL, [EHStart] [int] NULL, [EHEnd] [int] NULL, [EHSell] [money] NULL, CONSTRAINT [PK_Location_Times_1] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
Full error message:
"{" failed to initialize the collection: [WhygoDomain.Location.LocationTimes # 4] [SQL: SELECT locationti0_.Location_id as Location4_1_, locationti0_.ID as ID1_, locationti0_.ID as ID1_0_, locationti0_.LID as LID1_0_, locationti0__Hart1_0Start0_.hart FROM Location_Times locationti0_ WHERE locationti0_.Location_id =?] "}"
I see from sql in the error message that it is really looking for locationti0_.Location_id, which I know does not exist. I donβt know why he is looking for it.