How do I do this I am trying to make a one to one mapping.
public class Setting
{
public virtual Guid StudentId { get; set; }
public virtual DateFilt
First, define one of the sides of the relationship as Inverse(), otherwise there is a redundant column in the database and this may cause the problem.
If this doesn't work, output the SQL statements generated by NHibernate (using ShowSql or through log4net) and try to understand why the foreign key constraint is violated (or post it here with the SQL, and don't forget the values of the bind variables that appear afer the SQL statement).