I have two objects Foo and Bar :
public class Foo { public virtual Guid FooID { get; set; } public virtual Bar MyBar { get; set; } } public class Bar { public virtual Guid BarID { get; set; } public virtual Foo MyFoo { get; set; } }
both of these entities can exist independently of each other, but sometimes they are related to each other, and when this happens, I want to make sure that they are connected in the conservation level.
I want my tables to look like:
create table Foo ( FooID int primary key, -- other stuff ); create table Bar ( BarID int primary key, FooID int null references Foo(FooID) on delete no action on update no action );
... and for NHibernate to be able to create relationships between them.
How do I match this (preferred XML)?
source share