Does SQLite coupled with NHibernate support referential integrity / foreign keys?

前端 未结 1 833
面向向阳花
面向向阳花 2021-01-13 19:08

I have been reading a bit about NHibernate with SQLite, figuring it might be a very good option when I need lightweight database handling.

I\'ve read the following (

相关标签:
1条回答
  • 2021-01-13 19:38

    NHibernate 3.1 (currently available GA release) and earlier do not support FKs when generating a schema through SchemaExport/SchemaUpdate. If FKs are present, NHibernate will use them. Actually the database will use them and NHibernate will report back any FK violations as HibernateExceptions, just like any other database.

    Support for FK generation with SQLite is scheduled for release in NHibernate 3.2. The fix is in the trunk, specifically R5543:

    https://github.com/JamesKovacs/nhibernate/commit/2711450b8fcea66df41699ac595b4cc814d7f64b

    N.B. This is my GitHub mirror of the official SVN repo on SourceForge.net. GitHub just does a nicer, faster job on formatting patches.

    0 讨论(0)
提交回复
热议问题