NHibernate is driving me 'Nuts'!!!
I have the following mapping. Which returns this error when I try to add a record to the DB. "Unknown entity class: System.Int64"
<class name="CalConnector" table="tb_calConnectors" lazy="false" >
<id name="id" column="id">
<generator class="hilo"/>
</id>
<many-to-one name="calendarID" class="Calendar" lazy="false" cascade="save-update">
<column name="calendarID" sql-type="bigint" not-null="false"/>
</many-to-one>
I set the mapping up like this so when I generate the schema using the mapping files this foreign key is setup;
CONSTRAINT [FK94A85A28236EBB2B] FOREIGN KEY ([calendarID])
REFERENCES [dbo].[tb_calendars] ([id])
I generated the schema and everything was great. Now when I try and add a CalConnector with a reference to a existing calendarID I get an error. If I take out the many-to-one relationship; ie:
<property name="calendarID"/>
I can create the record but when NHibernate generates the schema the foreign key is not set.
It's taking me hours and hours just to set up some simple CRUD stuff. I'm hoping that NHibernate will give me some payback for all the time it takes to get right.
If anyone can spot the problem, please give me a hint then I can get this done and have a deserved beer. Any help much *2 appreciated.