本文介绍了Android SQLite 和数据库方案上的 ORM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个非常简单的 ORM 框架,可以在 Android 上运行 SQLite.我一直在测试 ActiveAndroid,但没有一个示例可以在 Eclipse 上构建.
顺便说一句,人们如何在 Android 的 SQLite 中实现多对多"关系?你如何反映行删除的级联并保证数据库的完整性?

I'm looking for a very simple ORM framework working on Android for SQLite. I've been testing ActiveAndroid but none of the example could ever build on Eclipse.
By the way, how do guys implement a "many to many" relationship in SQLite for Android? How do you reflect the cascade regarding deletion of rows and guarantee the database integrity?

推荐答案

我是 ORMLite 的主要作者一个 Android 后端,它调用原生 Android 操作系统数据库 API 以支持其 ORM 功能.我们有大量的 Android 开发人员成功地使用了该框架.请参阅此处了解更多信息:

I am the main author of ORMLite which has a Android backend which makes calls to the native Android OS database APIs to support its ORM functionality. We have a large number of Android developers that are using the framework successfully. See here for more information:

http://ormlite.com/sqlite_java_android_orm.shtml

就多对多关系而言,ORMLite 不支持级联或任何更高级的 ORM 功能,但有一些简单的多对多实现示例:

In terms of many-to-many relationships, ORMLite does not support cascading or any of the more advanced ORM features but there are examples of easy many-to-many implementations:

http://ormlite.com/docs/examples

这篇关于Android SQLite 和数据库方案上的 ORM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-21 04:28