I have something similar to this mapping situation in NHibernate:
ClassA mapping.Id(x => x.Id).Column("rowid").GeneratedBy.Identity().Unique(); ClassB mapping.Id(x => x.Id).Column("rowid").GeneratedBy.Identity().Unique(); mapping.References<ClassA>(x => x.ClassA).Nullable();
When NHibernate generates a database schema, it creates a foreign key between these tables, even if I specified the "Nullable" attribute in the mapping declaration. It's a shame if I try to save my objects, I get a foreign key constraint error and if I manually delete the foreign key from the database, it works like a charm.
How do I tell NHibernate not to create a foreign key script in this situation?
source share