使用SQlite数据库启用nHIbernate的参照完整性 [英] Enable referential integrity with nHIbernate using SQlite database

查看:117
本文介绍了使用SQlite数据库启用nHIbernate的参照完整性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家晚上好,

我有一个使用nHibernate(2.1.2.4000)和System.Data.SQLite(1.0.66.0)的项目。我希望强制NHibernate在创建数据库时创建外键,或者至少使用外键关键字,那么我就可以创建触发器。

我GOOGLE了,但我没有找到任何文件如何做到这一点,我失去了信仰。我真的不希望(也不会)检查我的代码中的参照完整性。

总之:如何启用参照完整性(或等效)与nHibernate和SQLite?



在此先感谢, 解决方案

迟到比从来没有:这是一个答案:

在SchemaExport中使用SQLite的Fluent NHibernate的外键



nHibernate Issue Tracker


Good evening everyone,

I've got a project using nHibernate (2.1.2.4000) and System.Data.SQLite (1.0.66.0). I want to enforce NHibernate to create foreign keys when it creates the database or at least use the "foreign key" keyword then I'll be able to create the triggers.

I googled but I didn't find any documentation on how to do that and I'm loosing the faith. I really don't want to (and I won't) check referential integrity inside my code.

In a word: how do I enable referential integrity (or equivalent) with nHibernate and SQLite?

Thanks in advance,

解决方案

Better late than never: here's an answer:

Foreign Keys with SchemaExport in Fluent NHibernate using SQLite

nHibernate Issue Tracker

这篇关于使用SQlite数据库启用nHIbernate的参照完整性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆