OK, maybe I missunderstood the meaning of <join> <key>. I was getting this error:
NHibernate.Exceptions.GenericADOException: could not insert: [CuriMSI.SportsManager.Framework.Model.Player][SQL: INSERT INTO sm_player (throwsBats, number, height, weight, statusId) VALUES (?, ?, ?, ?, ?)] ---> MySql.Data.MySqlClient.MySqlException: Field 'personId' doesn't have a default value.
I removed the "not null" requirement on sm_player.personId and got pass that error to this one:
NHibernate.Exceptions.GenericADOException: could not insert: [CuriMSI.SportsManager.Framework.Model.Player#1][SQL: INSERT INTO sm_person (firstName, lastName, middleName, nickName, maidenName, cityOfBirth, dateOfBirth, avatarURL, biography, memberId, personId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] ---> MySql.Data.MySqlClient.MySqlException: Unknown column 'personId' in 'field list'.
So instead of sm_player.personId, NHibernate thinks that I am defining sm_person.personId. How do I tell NHibernate that the join is from sm_player to sm_person and not the opposite?
_________________ Miguel Curi
|