Actually, I don't believe I need this. If WithForeignKey() is omitted,
the "foreign-key" attribute isn't in the HBM XML, but that's OK
because NH creates a uniquely named foreign key constraint. (I
verified this behavior against an MS SQL 2005 databse.)

The problem I am running into is unrelated: I'm using a SQLite .db
file as my test database, and the SchemaExport() tool is not emitting
the foreign key creation SQL code.

Sorry for the noise.

On Feb 14, 6:16 pm, "Ed C." <[email protected]> wrote:
> Hi, list --
>
> I'm using the AutoPersistenceModel and can manually call
> ForDerivedTypeOf<...> and add References(...).WithForeignKey()
>
> Instead of doing that for each model/entity, is it possible to define
> that in a Convention? Something like ManyToOneConvention = one =>
> one.WithForeignKey()
>
> (I have recently discovered the joys of FNH - thanks for all the hard
> work!)
>
> Thanks for your time,
> Ed C.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to